1 2006-07-28 Raja R Harinath <rharinath@novell.com>
3 * class.cs (TypeContainer.AddMemberType): Rename from
5 (TypeContainer.AddMember): Rename from AddToMemberContainer.
6 (AddTypeContainer): New. Combine AddClassOrStruct and
8 (AddPartial): Update. Add 'is_partial' argument.
9 * roottypes.cs: Update to changes.
10 * cs-parser.jay (push_current_class): New helper for handling
11 current_container and current_class.
12 (struct_declaration, interface_declaration, class_declaration):
15 2006-07-26 Raja R Harinath <rharinath@novell.com>
17 * roottypes.cs: Rename from tree.cs.
19 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
20 * tree.cs (Tree, ITreeDump): Remove types.
21 * rootcontext.cs (tree, Tree): Remove fields.
22 (root, ToplevelTypes): New.
23 * *.cs: Update to rename.
25 * tree.cs (Tree.RecordDecl): Remove.
26 (RootTypes.AddToTypeContainer): Record the toplevel type in its
28 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
30 2006-07-23 Raja R Harinath <harinath@gmail.com>
32 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
33 DoFlowAnalysis and OmitStructFlowAnalysis here.
34 (ec.With): Rename from WithUnsafe and generalize.
35 (ec.WithCheckState): Remove. All users can be handled by 'With'.
36 (ec.WithFlowAnalyis): New.
37 * ecore.cs, expression.cs, statement.cs: Update.
39 2006-07-22 Raja R Harinath <harinath@gmail.com>
41 * statement.cs (Block.ResolveMeta): Simplify slightly.
43 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
44 multiple boolean fields. Convert InUnsafe, constant_check_state,
46 (CheckState, ConstantCheckState): Update.
47 (InUnsafe): New read-only property.
48 (FlagsHandle): Rename from CheckStateHandle and convert to handle
50 (WithUnsafe): New helper similar to WithCheckState.
51 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
52 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
54 2006-07-21 Raja R Harinath <rharinath@novell.com>
56 Make comparisons use the same IL irrespective of whether they're
57 in a 'checked' or 'unchecked' context: one of the issues in #78899
58 * codegen.cs (EmitContext.CheckState): Make read-only property.
59 (EmitContext.ConstantCheckState): Likewise.
60 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
61 helper that implement a save/restore stack for CheckState
62 values. This is the only way to change check-state.
63 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
64 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
65 (CheckedExpr.EmitBranchable): New forwarding method.
66 (UnCheckedExpr): Likewise.
67 * statement.cs (Block.ResolveMeta): Use WithCheckState.
68 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
69 (Checked.Resolve, checked.DoEmit): Likewise.
71 2006-07-21 Martin Baulig <martin@ximian.com>
73 * generic.cs (TypeManager.InferType): When inferring an array
74 type, also allow IList<T> and ICollection<T>. Fixes #78900.
76 2006-07-21 Martin Baulig <martin@ximian.com>
78 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
79 and allow IList`1 and all its base interfaces.
81 * convert.cs (Convert.ImplicitReferenceConversion): Allow
82 converting from an array-type of T to IList<T>.
84 2006-07-21 Martin Baulig <martin@ximian.com>
86 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
88 2006-07-20 Miguel de Icaza <miguel@novell.com>
90 * anonymous.cs: Cache the resolved anonymous delegate, and return
91 this so that the ResolveTopBlock is only triggered once, not
94 Currently we trigger ResolvetopBlock twice due to a first pass of
95 argument check compatibility, and a second pass that does the
98 2006-07-16 Marek Safar <marek.safar@seznam.cz>
101 * driver.cs (MainDriver): When a file extension is missing,
104 2006-07-15 Marek Safar <marek.safar@seznam.cz>
106 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
108 * rootcontext.cs (Reset): Add helper_classes.
110 2006-07-15 Marek Safar <marek.safar@seznam.cz>
113 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
116 2006-07-13 Miguel de Icaza <miguel@novell.com>
118 * statement.cs (Lock): Handle expressions of type
119 TypeManager.null_type specially. Fixes #78770
121 2006-07-08 Marek Safar <marek.safar@seznam.cz>
123 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
126 2006-07-08 Marek Safar <marek.safar@seznam.cz>
128 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
129 for accessors as well.
130 * ecore.cs (EventExpr): Add AccessorTable.
132 2006-07-03 Martin Baulig <martin@ximian.com>
134 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
135 instances of value types.
137 * convert.cs (Convert.ExplicitConversion): Correctly handle
138 object->nullable conversions.
140 2006-07-01 Marek Safar <marek.safar@seznam.cz>
143 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
144 for CS0122 where appropriate.
145 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
147 (Filter): Assembly can be null in the case of top level attributes.
149 2006-06-28 Raja R Harinath <rharinath@novell.com>
152 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
153 no arguments, return 'false': nothing can be inferred.
155 2006-06-25 Marek Safar <marek.safar@seznam.cz>
159 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
160 is done at global level.
162 2006-06-24 Marek Safar <marek.safar@seznam.cz>
164 A fix for #77002, Implemented TypeForwarder support.
166 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
167 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
169 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
170 * typemanager.cs (): Add type_forwarder_attr_type.
172 2006-06-24 Marek Safar <marek.safar@seznam.cz>
174 * report.cs: Add CS0469 warning.
176 2006-06-22 Martin Baulig <martin@ximian.com>
179 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
180 for interfaces; fixes #78686, which is a modification of #78380
181 with interfaces instead of classes.
183 2006-06-21 Martin Baulig <martin@ximian.com>
185 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
186 the `try'-block, so we also report CS0016 etc. there.
188 2006-06-21 Martin Baulig <martin@ximian.com>
190 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
191 handle SetAssigned() and SetMemberIsUsed() for generic types;
194 2006-06-21 Martin Baulig <martin@ximian.com>
197 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
199 2006-06-21 Martin Baulig <martin@ximian.com>
201 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
202 also report CS1686 for parameters.
204 2006-06-21 Martin Baulig <martin@ximian.com>
206 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
207 instead of an error if the value is not implicitly convertible to
208 the switch types; fixes #77964.
210 2006-06-21 Raja R Harinath <rharinath@novell.com>
213 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
214 FieldBuilder is null.
217 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
218 'left' and 'right' before error-checking.
220 2006-06-19 Martin Baulig <martin@ximian.com>
223 (Convert.ImplicitConversionStandard): Cleanup and correctly
224 implement nullable conversions.
225 (Convert.ImplicitStandardConversionExists): Likewise.
226 (Convert.ExplicitConversion): Likewise.
228 2006-06-19 Martin Baulig <martin@ximian.com>
231 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
232 methods; make the ctors protected.
234 2006-06-19 Martin Baulig <martin@ximian.com>
236 Fixed #78380; added gtest-273.cs.
239 (Expression.ResolveAsBaseTerminal): Move the constraint checking
240 into ResolveAsTypeTerminal().
243 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
244 TypeManager.FindMembers() to check for the default ctor.
246 2006-06-18 Marek Safar <marek.safar@seznam.cz>
248 * generic.cs: Fixed NullableInfo accessibility.
250 2006-06-16 Martin Baulig <martin@ximian.com>
253 (Constraints.InflatedConstraints.inflate): Correctly inflate
254 generic types; fixes #78400.
256 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
258 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
260 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
261 (FieldExpr.DoResolve): likewise.
262 (PropertyExpr.InstanceResolve): likewise.
263 (EventExpr.InstanceResolve): likewise.
265 2006-06-15 Martin Baulig <martin@ximian.com>
268 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
269 argument; always allow a `null' label if true.
270 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
271 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
272 we have a `null' label and mark the new `null_target' label;
273 default to the `default' label.
274 (Switch.Resolve): Add support for nullable types. Fixes #78630.
276 2006-06-15 Martin Baulig <martin@ximian.com>
278 * class.cs (Operator.Define): Allow an implicit/explicit operator
279 to convert to/from a nullable value of the enclosing type.
281 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
282 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
285 (Convert.ImplicitStandardConversionExists): Add support for lifted
286 implicit/explicit conversions.
287 (Convert.ImplicitConversionStandard): Likewise.
289 2006-06-13 Martin Baulig <martin@ximian.com>
291 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
292 type arguments and create a ConstructedType if necessary. Fixes #78400.
294 2006-06-04 Marek Safar <marek.safar@seznam.cz>
296 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
297 attribute applicable tests for attribute argument.
299 2006-06-02 Raja R Harinath <rharinath@novell.com>
302 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
303 (Binary.OverloadResolve_PredefinedIntegral): New.
304 (Binary.OverloadResolve_PredefinedFloating): New.
305 (Binary.OverloadResolve_PredefinedString): New.
306 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
307 Follow the standard more closely, and treat numeric promotions in
308 terms of overload resolution.
309 (Binary.CheckShiftArguments): Simplify.
311 2006-06-01 Raja R Harinath <rharinath@novell.com>
313 * flowanalysis.cs (MyBitVector): Simplify representation.
314 (MyBitVector.Clone): Avoid allocating BitArray.
315 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
316 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
317 (*): Update. Change all references to MyBitVector.And and
318 MyBitVector.Or to &= and |=.
320 2006-05-31 Raja R Harinath <rharinath@novell.com>
322 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
323 Use bne.un instead of ceq+brfalse.
326 * typemanager.cs (IsUnmanagedType): Disallow generic types and
329 2006-05-29 Raja R Harinath <rharinath@novell.com>
332 * cs-parser.jay (formal_parameter_list): Extend the pattern below
333 to param arguments too.
335 2006-05-26 Miguel de Icaza <miguel@novell.com>
337 * cs-parser.jay: Catch another parsing form for arglist being
338 followed by other arguments. Fixes #78313.
340 2006-05-25 Raja R Harinath <rharinath@novell.com>
343 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
344 also when one of the operands is a null literal.
345 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
346 to improve clarity, and generate slightly better code.
348 2006-05-24 Raja R Harinath <rharinath@novell.com>
350 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
351 checking of out parameters to ...
352 (FlowBranchingToplevel.Merge): ... here.
353 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
354 set, propagate the origin upward, and only complain if there was
356 (FlowBranchingException.AddContinueOrigin): Likewise.
357 (FlowBranchingException.AddReturnOrigin): Likewise.
358 (FlowBranchingException.AddGotoOrigin): Likewise.
360 2006-05-23 Raja R Harinath <rharinath@novell.com>
362 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
363 unreachable, skip it.
364 (FlowBranchingException.Merge): Always propagate jumps, even if
365 the finally block renders subsequent code unreachable.
367 2006-05-18 Raja R Harinath <rharinath@novell.com>
370 * statement.cs (Goto.Resolve): Move responsibility for resolving
371 'goto' to FlowBranching.AddGotoOrigin.
372 (Goto.SetResolvedTarget): New. Callback to set the
373 LabeledStatement that's the target of the goto.
374 (Goto.DoEmit): Use Leave instead of Br when crossing an
375 unwind-protect boundary.
376 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
377 LookupLabel and adjust to new semantics.
378 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
379 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
380 Goto.SetResolvedTarget to update target.
381 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
382 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
383 AddBreakOrigin & co. Delay propagation until ...
384 (FlowBranchingException.Merge): ... this.
386 * statement.cs (Block.Resolve): Always depend on flow-branching to
387 determine unreachability. Kill workaround that originally emitted
388 only one statement after an "unreachable" label (see infloop in
391 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
392 This is still "wrong", but anything better would probably need a
393 multi-pass algorithm.
394 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
395 usage vector. Force current usage vector to be reachable, to
396 optimistically signify backward jumps.
397 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
399 (FlowBranchingLabeled.Merge): New. If no backward jump was
400 detected, return the original salted-away usage vector instead,
401 updated with appropriate changes. Print unreachable warning if
403 * statement.cs (Block.Resolve): Don't print unreachable warning on
406 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
408 * driver.cs: Pass filename without path to AssemblyBuilder's
409 AddResourceFile. Fixes bug #78407.
411 2006-05-17 Raja R Harinath <rharinath@novell.com>
413 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
414 * flowanalysis.cs (FlowBranchingLabeled): ... here.
415 (FlowBranching.MergeChild): Overwrite
416 reachability information from Labeled branchings too.
418 2006-05-16 Raja R Harinath <rharinath@novell.com>
420 * statement.cs (Goto.Resolve): Merge jump origins here ...
421 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
423 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
424 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
425 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
426 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
428 * statement.cs (Goto.Resolve): ... not here.
429 (Goto.Emit): Remove CS1632 check.
431 2006-05-14 Marek Safar <marek.safar@seznam.cz>
433 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
436 2006-05-11 Raja R Harinath <rharinath@novell.com>
438 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
439 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
440 (FlowBranchingException.Label): Likewise.
442 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
444 (MyBitVector.Or): Use it to avoid losing information (Count).
445 (FlowBranching.MergeOrigins): Likewise.
447 * flowanalysis.cs (UsageVector.IsDirty): Remove.
448 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
449 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
450 (UsageVector.ToString): Simplify.
451 (UsageVector.MergeSiblings): Move here from ...
452 (FlowBranching.Merge): ... here.
453 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
456 2006-05-10 Raja R Harinath <rharinath@novell.com>
458 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
459 null bitvector is treated as all-true.
461 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
462 (MyBitVector): Rationalize invariants. 'vector != null' implies
463 that we have our own copy of the bitvector. Otherwise,
464 'InheritsFrom == null' implies all inherited bits are true.
466 2006-05-09 Marek Safar <marek.safar@seznam.cz>
468 * statement.cs (LocalInfo): Add IsConstant.
469 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
470 local variable for constants.
472 2006-05-09 Raja R Harinath <rharinath@novell.com>
474 * flowanalysis.cs (MyBitVector.Empty): New.
475 (MyBitVector): Don't allow InheritedFrom to be null.
476 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
477 (UsageVector, FlowBranching): Update to changes.
479 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
480 recursion. The 'Parent == null' condition isn't sufficient for
482 (FlowBranching.AddBreakOrigin): Likewise.
483 (FlowBranching.AddContinueOrigin): Likewise.
484 (FlowBranching.AddReturnOrigin): Likewise.
485 (FlowBranching.StealFinallyClauses): Likewise.
486 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
487 (FlowBranching.CheckOutParameters): Likewise.
488 (FlowBranchingToplevel): Terminate all the above recursions here.
489 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
490 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
492 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
494 (FlowBranchingToplevel): New. Empty for now.
495 (FlowBranching.MergeTopBlock): Update.
496 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
497 branching for the anonymous delegate.
498 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
500 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
501 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
502 information at the start of the merge. Reorganize.
504 2006-05-07 Marek Safar <marek.safar@seznam.cz>
506 * class.cs (MethodData.Define): Method cannot implement interface accessor.
508 2006-05-07 Marek Safar <marek.safar@seznam.cz>
510 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
511 to newly introduced ctor.
513 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
514 message to one place.
515 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
518 2006-05-07 Marek Safar <marek.safar@seznam.cz>
520 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
522 * ecore.cs (Expression.ResolveAsConstant): Updated.
524 * statement.cs (ResolveMeta): Updated.
526 2006-05-06 Marek Safar <marek.safar@seznam.cz>
528 * cs-parser.jay: __arglist cannot be used in initializer.
530 2006-05-06 Marek Safar <marek.safar@seznam.cz>
533 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
536 2006-05-05 Raja R Harinath <rharinath@novell.com>
538 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
539 (LabeledStatement): Add 'name' parameter.
540 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
541 (Block.AddLabel): Update to changes.
542 * cs-parser.jay (labeled_statement): Likewise.
544 * flowanalysis.cs (BranchingType.Labeled): New.
545 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
546 (FlowBranchingLabeled): New. Does nothing for now, but will
547 eventually handle 'goto' flows.
548 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
549 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
550 that's terminated ...
551 (Block.Resolve): ... here.
553 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
554 (UsageVector.MergeFinallyOrigins): Likewise.
555 (FlowBranching.InTryOrCatch): Likewise.
556 (FlowBranching.AddFinallyVector): Likewise.
557 (FlowBranchingException): Update to changes.
560 * statement.cs (Return.Resolve): Move error checking to ...
561 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
562 (FlowBranchingException): Handle return origins like break and
564 (FlowBranching.UsageVector.CheckOutParameters): Remove.
566 2006-05-04 Marek Safar <marek.safar@seznam.cz>
569 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
572 2006-05-04 Marek Safar <marek.safar@seznam.cz>
575 * class.cs (MethodData.Define): Do public accessor check only when method
576 implements an interface.
578 2006-05-04 Raja R Harinath <rharinath@novell.com>
580 Remove special handling of 'break'
581 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
582 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
583 (UsageVector.Break): Remove.
584 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
586 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
588 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
589 UsageVector.Breaks (). Don't set NeedsReturnLabel.
591 2006-05-03 Marek Safar <marek.safar@seznam.cz>
594 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
595 be the interface member.
597 2006-05-03 Marek Safar <marek.safar@seznam.cz>
600 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
601 for emitting small (int) values.
603 2006-05-03 Raja R Harinath <rharinath@novell.com>
606 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
607 control-flow passes through the 'finally' after merging-in all the
608 control-flows from 'try' and the 'catch' clauses.
610 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
611 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
612 always true at the only non-recursive entry point.
613 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
614 FlowBranchingBreakable.
615 (FlowBranchingLoop): Remove.
616 * statement.cs (Return.DoResolve): Update to changes.
619 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
620 (FlowBranching.CreateBranching): Handle it: create a
621 FlowBranchingContinuable.
622 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
623 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
624 except that it handles the 'continue' command.
625 (FlowBranching.UsageVector.MergeOrigins): Rename from
627 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
628 except that it overrides AddContinueOrigin.
629 (FlowBranchingException): Override AddContinueOrigin, similar to
631 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
632 Create a new branching around the embedded statement.
633 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
634 control flow after the embedded statement.
635 (Continue.Resolve): Move all error checking to AddContinueOrigin.
637 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
638 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
639 FlowBranchingBreakable.
640 (FlowBranchingSwitch): Remove.
643 * statement.cs (Break.Resolve): Simplify. Move responsibility for
644 error reporting to ...
645 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
646 Rename from 'AddBreakVector'. Add new location argument. Return
647 a bool indicating whether the 'break' crosses an unwind-protect.
648 (FlowBranchingException.AddBreakOrigin): Add.
649 (FlowBranchingException.Merge): Propagate 'break's to surrounding
650 flowbranching after updating with the effects of the 'finally'
652 (FlowBranchingBreakable): New common base class for
653 FlowBranchingLoop and FlowBranchingSwitch.
655 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
657 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
659 2006-05-02 Raja R Harinath <rharinath@novell.com>
661 * statement.cs (Do.Resolve): If the loop is infinite, set the
663 (While.Resolve, For.Resolve): Set a barrier after the embedded
664 statement. There's no direct control flow that goes from the end
665 of the embedded statement to the end of the loop.
666 * flowanalysis.cs (FlowBranching.Infinite): Remove.
667 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
668 above ensure that the reachability is correctly computed.
670 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
671 (UsageVector.MergeBreakOrigins): If the current path is
672 unreachable, treat it as if all parameters/locals are initialized.
673 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
674 infinite loops before merging-in break origins.
676 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
677 (Reachability.Reachable): Split part into ...
678 (Reachability.Unreachable): ... this. Simplify.
679 (Reachability.IsUnreachable): Use 'Unreachable' instead.
681 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
682 (Reachability.SetThrowsSometimes): Likewise.
683 (FlowBranchingBlock.MergeTopBlock): Don't compare against
684 TriState.Always, use corresponding property.
685 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
686 (Block.Resolve): Likewise. Remove some redundant checks.
688 2006-05-02 Raja R Harinath <harinath@gmail.com>
690 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
691 (Reachability.Meet): Don't bother checking AlwaysThrows --
692 barrier is always set.
693 (FlowBranchingBlock.Merge): Likewise.
695 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
697 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
698 defined, so it's references should also compile only for NET_2_0
699 (as occurs in mcs version)
701 2006-05-01 Raja R Harinath <harinath@gmail.com>
703 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
704 checks for unreachable.
706 2006-05-01 Marek Safar <marek.safar@seznam.cz>
709 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
711 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
712 whether field is really assigned.
714 2006-04-30 Raja R Harinath <harinath@gmail.com>
716 * flowanalysis.cs (Reachability): Make 4-argument constructor
718 (Reachability.Meet): Rename from 'And'. Remove static variant.
719 (Reachability.Always): Rename from the highly misleading
720 'Reachability.Never'.
721 (FlowBranching.Merge): Update to changes. Mark an impossible
722 situation with a 'throw'.
723 (*): Update to changes.
725 2006-04-29 Raja R Harinath <harinath@gmail.com>
727 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
729 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
730 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
731 (*): Update to changes.
732 * statement.cs: Update to changes.
734 2006-04-28 Marek Safar <marek.safar@seznam.cz>
737 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
739 2006-04-28 Raja R Harinath <harinath@gmail.com>
741 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
744 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
745 argument to two arguments: an usage-vector and a bool. Move call
746 to FlowBranching.Merge () ...
747 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
749 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
750 handling of loop and switch reachability to ...
751 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
753 2006-04-27 Raja R Harinath <harinath@gmail.com>
755 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
756 handling to FlowBranchingLoop.InLoop.
757 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
759 2006-04-26 Marek Safar <marek.safar@seznam.cz>
762 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
763 anonymous method is allowed from AnonymousContainer here.
765 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
767 2006-04-24 Raja R Harinath <rharinath@novell.com>
770 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
772 2006-04-23 Marek Safar <marek.safar@seznam.cz>
775 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
776 (DoubleConstant.Reduce): Ditto.
778 2006-04-23 Raja R Harinath <rharinath@novell.com>
780 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
781 Remove 'lvalue_right_side' argument. Move parts to ...
782 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
783 (LocalVariable.DoResolveLValue): ... these.
785 2006-04-21 Raja R Harinath <rharinath@novell.com>
788 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
789 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
790 (LocalVariableReference.DoResolveBase): Use it to implement new
792 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
793 (Argument.Resolve): Simplify. Move CS1510 check ...
794 * ecore.cs (Expression.ResolveLValue): ... here.
795 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
796 (PropertyExpr.DoResolveLValue): Likewise.
797 (FieldExpr.Report_AssignToReadonly): Likewise.
798 (FieldExpr.DoResolve): Add 'out_access' argument. Use
799 LValueMemberAccess or LValueMemberOutAccess on instance depending
801 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
802 DoResolve as appropriate.
804 2006-04-20 Raja R Harinath <rharinath@novell.com>
807 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
808 implicit conversions on 'out' and 'ref' arguments.
810 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
811 improve clarity. Remove dead code.
814 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
815 (Catch.Resolve): Resolve VarBlock if it exists.
817 2006-04-19 Miguel de Icaza <miguel@novell.com>
819 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
820 twice, this was some residual code, the enumerator was emitted
821 properly in the two branche of if later.
825 Thanks to Martin for finding the source of the problem
827 2006-04-19 Raja R Harinath <rharinath@novell.com>
829 * expression.cs (Cast.ResolveLValue): Remove. The result of a
830 cast is never an lvalue.
831 (Cast.DoResolve, Cast.ResolveRest): Combine.
832 (Argument.Emit): Simplify slightly. Move 'Expr is
833 IMemoryLocation' check ...
834 (Argument.Resolve): ... here.
835 (Argument.Error_LValueRequired): Remove. Inline into only user.
837 Simplifications. Fix cs0191-2.cs
838 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
839 CS1649 and CS1651 to ...
840 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
841 the actual selection of the error code and message to a lookup
842 table. Add a dummy return value to simplify callsites.
843 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
844 readonly fields of other instances of the same type. Move CS0197
846 * expression.cs (Argument.Resolve): ... here. Simplify code.
847 Ensure that ec.InRefOutArgumentResolving is only set during LValue
848 resolution of an out or ref argument. The code simplification
849 above uses this invariant.
851 2006-04-18 Raja R Harinath <rharinath@novell.com>
853 Possibly fix #77752. Fix cs1690-[4-7].cs.
854 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
855 CheckMarshallByRefAccess. Drop parameter.
856 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
858 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
860 * report.cs (AllWarnings): Add CS1690.
861 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
863 (LocalVariableReference.DoResolveBase): Update.
865 2006-04-09 Marek Safar <marek.safar@seznam.cz>
867 * class.cs (MethodOrOperator): Moved common parts from method class.
868 detect obsolete attributes.
869 (Method.Define): Simplified as it reuses code from base.
870 (Constructor.ValidAttributeTargets): Fixed issue found during
872 (Destructor.ValidAttributeTargets): Fixed issue found during
874 (Operator): Finished refactoring set off by #78020. Operator class is now
875 ordinary method class.
877 * anonymous.cs: Updated.
879 2006-04-09 Marek Safar <marek.safar@seznam.cz>
881 * class.cs (Constructor.Emit): Don't emit the attributes twice.
883 2006-04-09 Marek Safar <marek.safar@seznam.cz>
885 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
886 detect obsolete attributes.
887 (Method.CreateEmitContext): Moved to MethodOrOperator.
889 2006-04-09 Marek Safar <marek.safar@seznam.cz>
892 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
893 customized exception to make crash detection easier.
894 (MethodOrOperator): Started to work on new base class for methods and
896 (Method): Derives from MethodOrOperator.
897 (Constructor.Emit): Emits its own attributes.
898 (AbstractPropertyEventMethod.Emit): Ditto.
899 (Operator): Derives from MethodOrOperator, will refactor fully in extra
901 (Operator.Emit): It's temporary more tricky than should be.
903 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
905 * report.cs (InternalErrorException): Add ctor with inner exception.
907 2006-04-08 Marek Safar <marek.safar@seznam.cz>
910 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
913 2006-04-07 Marek Safar <marek.safar@seznam.cz>
916 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
919 2006-04-06 Marek Safar <marek.safar@seznam.cz>
921 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
922 attribute is present and Guid not.
923 (Interface.ApplyAttributeBuilder): Ditto.
925 * attribute.cs: Add error message.
927 2006-04-06 Marek Safar <marek.safar@seznam.cz>
931 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
932 sources (it's composite) so hold them in extra array as they are used in
933 Emit phase only. It worked in the previous versions by mistake.
934 (Attribute.Emit): Emit attribute for more owners when exist.
936 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
937 it has now different behaviour.
939 2006-04-04 Marek Safar <marek.safar@seznam.cz>
941 * constant.cs (Constant.IsDefaultInitializer): New method.
945 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
946 re-initialize default values. It saves KBs almost for every assembly.
947 Thanks Zoltan for the idea.
948 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
949 (ArrayCreation.DoResolve): Resolve only once.
950 (ArrayCreation.Emit): Emit static initializer only when it is faster.
951 (ArrayCreation.GetAttributableValue): Cope with optimized values.
953 2006-04-03 Zoltan Varga <vargaz@gmail.com>
955 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
958 2006-04-01 Marek Safar <marek.safar@seznam.cz>
960 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
961 in an embedded statement too.
963 2006-04-01 Raja R Harinath <rharinath@novell.com>
966 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
970 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
973 * report.cs (SymbolRelatedToPreviousError): Drop generic type
974 arguments before checking whether a type is reflected or not.
977 * expression.cs (Invocation.IsApplicable): Ensure a generic method
978 definition doesn't take part in overload resolution.
979 (Invocation.IsParamsMethodApplicable): Likewise.
980 (Invocation.OverloadResolve): When replacing a reflected override
981 method with its base definition, ensure that type arguments are
984 2006-04-01 Marek Safar <marek.safar@seznam.cz>
988 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
991 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
993 2006-03-31 Marek Safar <marek.safar@seznam.cz>
995 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
998 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
999 LocalTemporary change.
1001 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1003 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1004 initializers optimization.
1005 (ClassOrStruct.TypeAttr): Moved from modifiers.
1006 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1007 (FieldBase.ResolveInitializer): Resolves initializer.
1008 (FieldBase.HasDefaultInitializer): New property.
1010 * cs-parser.jay: Removed message.
1012 * expression.cs (CompilerGeneratedThis): New specialization.
1014 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1016 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1018 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1020 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1022 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1023 be now EnumConstants only.
1025 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1027 * attribute.cs, driver.cs: Reset more caches.
1029 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1031 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1033 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1035 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1036 for easier reuse. Updated all overrides.
1037 (IntegralConstant): New base class for all integral constants.
1038 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1039 of the constant range, report custom error.
1040 (UIntConstant.Reduce): Fixed uint conversion.
1042 * ecore.cs, literal.cs: Reduce updates.
1044 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1048 * class.cs (Constructor.Define): Removed extra if for default ctors.
1049 A patch from Atsushi Enomoto.
1051 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1053 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1054 GetAttributableValue.
1056 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1059 * convert.cs (ImplicitConversionRequired): Error message moved to
1062 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1063 automatic implicit conversion of an output value.
1064 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1066 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1068 (TypeOf.GetAttributableValue): Add extra handling for object type.
1070 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1071 special error message.
1073 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1075 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1077 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1078 compatible with MS runtime.
1080 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1082 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1083 attribute arguments here.
1085 * class.cs (Indexer.Define): The check was moved to attribute class.
1087 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1089 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1091 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1093 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1095 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1098 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1100 * doc-bootstrap.cs : fix build.
1102 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1104 * expression.cs (StringConcat.Append): Issue a warning when empty string
1107 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1109 * assign.cs (CompoundAssign.ResolveSource): Removed.
1111 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1114 * class.cs (TypeContainer.FindMethods): Removed.
1115 (TypeContainer.CheckMemberUsage): Made static.
1117 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1119 * constant.cs (CheckRange): Removed unused type argument.
1120 (CheckUnsigned): Removed unused type argument.
1122 * cs-parser.jay: Updated after MemberAccess clean up.
1123 Uses Length for empty string test.
1125 * cs-tokenizer.cs: Uses Length for empty string test.
1126 (IsCastToken): Made static.
1127 (is_hex): Made static.
1128 (real_type_suffix): Made static.
1130 * decl.cs (SetupCache): Made static.
1131 (OnGenerateDocComment): Removed unused ds argument.
1133 * delegate.cs (VerifyDelegate): Removed unused argument.
1135 * doc.cs: Uses Length for empty string test.
1137 * driver.cs: Uses Length for empty string test.
1139 * enum.cs (IsValidEnumType): Made static
1141 * expression.cs (EnumLiftUp): Removed unused argument.
1142 (ResolveMethodGroup): Ditto.
1143 (BetterConversion): Ditto.
1144 (GetVarargsTypes): Ditto.
1145 (UpdateIndices): Ditto.
1146 (ValidateInitializers): Ditto.
1147 (MemberAccess.ctor): Ditto.
1148 (GetIndexersForType): Ditto.
1150 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1152 * iterators.cs: Updated after MemberAccess clean up.
1154 * location.cs: Uses Length for empty string test.
1156 * namespace.cs: Uses Length for empty string test.
1158 * report.cs (CheckWarningCode): Made static.
1160 * statement.cs (LabeledStatement): Removed unused argument.
1162 * typemanager.cs (FilterNone): Removed.
1164 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1166 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1169 * class.cs: Updated.
1171 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1173 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1175 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1179 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1181 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1182 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1183 Add more error reporting; Fixed issue with params.
1185 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1187 * cs-parser.jay: AnonymousMethod requires host container.
1189 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1191 2006-03-18 Raja R Harinath <harinath@gmail.com>
1193 * class.cs: Change 'TypeContainer ds' constructor argument to
1194 'DeclSpace parent'. Some classes were missed below due to
1195 different naming convention.
1197 * class.cs (MemberCore.Parent): Delete. This makes the
1198 ParentContainer changes below enforceable by the compiler.
1200 Treat pointers to enclosing declaration space as 'DeclSpace', not
1202 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1203 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1205 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1207 (Block.AddThisVariable): Likewise.
1208 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1209 (AbstractPropertyEventMethod.Emit): Likewise.
1210 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1211 (GetMethod.Define, SetMethod.Define): Likewise.
1212 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1213 (DelegateMethod.EmitMethod): Likewise.
1215 Fix regression test-partial-13.cs.
1216 Rationalize use of PartialContainer. Ensure that the partial
1217 class semantics can be tied to type-correctness, i.e., any
1218 violation will cause a compile error.
1219 * class.cs, const.cs: Access all fields that belong to class
1220 TypeContainer via ParentContainer. Arguments of EmitContexts and
1221 Resolve()-like functions still use 'Parent'.
1223 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1224 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1225 (PropertyMethod.CheckModifiers): Remove unused argument.
1226 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1229 2006-03-28 Raja R Harinath <rharinath@novell.com>
1231 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1233 2006-03-17 Raja R Harinath <harinath@gmail.com>
1235 Make semantics of PartialContainer simpler.
1236 * decl.cs (DeclSpace.IsPartial): Remove.
1237 * class.cs (TypeContainer.IsPartial): Likewise.
1238 (TypeContainer..ctor): Set PartialContainer to point to self.
1239 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1240 (TypeContainer.FindNestedType): Likewise.
1241 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1243 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1245 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1247 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1249 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1252 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1254 * class.cs (Operator.Define): An error for base conversion was not
1257 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1259 A fix for #77593, #77574.
1261 * class.cs (MethodCore.CheckBase): Another if for operator.
1263 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1267 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1268 reporting, it's more tricky than I thought.
1270 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1272 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1275 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1276 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1279 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1282 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1286 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1287 (Event.Define): ditto
1288 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1290 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1291 Removed redundant code and set NewSlot for Invoke method too.
1293 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1294 (Parameters.MergeGenerated): New method. Use this method when you merge
1295 compiler generated argument with user arguments.
1297 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1299 * attribute.cs (ResolveAsTypeTerminal): Removed.
1301 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1302 specialization for predefined types; 30% speed up.
1303 Finally placed obsolete check to right place.
1304 (Expression.ResolveType): Removed.
1306 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1307 Updated after ResolveType was removed.
1309 * expression.cs (Cast.ctor): Check void cast.
1310 (Binary.ResolveAsTypeTerminal): Is never type.
1311 (Conditional.ResolveAsTypeTerminal): Is never type.
1313 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1315 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1317 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1319 2006-03-23 Martin Baulig <martin@ximian.com>
1321 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1322 type check if either of the types is an open generic type.
1324 2006-03-23 Martin Baulig <martin@ximian.com>
1327 (Convert.ExplicitTypeParameterConversion): New method; implement
1328 explicit type parameter conversions.
1330 2006-03-23 Martin Baulig <martin@ximian.com>
1332 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1333 blindly allow all conversions if we do not have any constraints.
1335 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1337 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1338 these two separated members to simplify the code.
1339 (Attribute.Resolve): Refactored to use new fields and methods.
1340 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1341 implemented obsolete attribute checking.
1342 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1343 implemented obsolete checking again. It look line never ending quest ;-)
1344 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1346 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1348 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1350 *class.cs (Property.Define): Add RegisterProperty call.
1352 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1353 argument groups (only 2).
1355 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1356 encoding expression to arguments.
1357 (Expression.ExprClassToResolveFlags): Just turned to property.
1359 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1360 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1361 optimized as well as implemented support for zero-length attributes.
1363 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1364 Add caching of PropertyInfo's.
1366 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1368 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1369 error multiple times.
1371 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1373 New partial class implementation.
1374 A fix for #77027, #77029, #77403
1376 * attribute.cs (Attributable): Made attributes protected.
1378 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1379 the replacements of ClassPart and PartialContainer.
1380 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1381 (TypeContainer.AddInterface): Ditto.
1382 (TypeContainer.AddPartial): The main method for partial classes. It checks
1383 for errors and merges ModFlags and attributes. At the end class is added to
1385 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1387 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1388 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1389 from the rest of partial classes.
1390 (TypeContainer.GetClassBases): Simplified.
1391 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1393 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1394 (TypeContainer.HasExplicitLayout): Uses Flags now.
1395 (PartialContainer): Removed.
1396 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1397 (StaticClass): Was merged with Class.
1398 (Class.GetClassBases): class and static class bases are verified here.
1399 (Class.TypeAttr): Added static attributes when class is static.
1400 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1401 (MemberBase): In some cases we need to call parent container for partial
1402 class. It should be eliminated but it's not easy now.
1404 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1406 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1407 partial classed to accumulate class comments.
1408 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1410 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1412 * driver.cs (MainDriver): Tree.GetDecl was removed.
1414 * modifiers.cs (Modifiers): Add partial modifier.
1416 * tree.cs (Tree.decl): Removed.
1417 (RootTypes): Started to use this class more often for root types
1420 2006-03-23 Raja R Harinath <rharinath@novell.com>
1422 * generic.cs (TypeParameter.UpdateConstraints): Update
1423 'constraints' if null.
1425 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1429 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1430 external interface does not have an attribute.
1432 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1434 Another prerequisites for new partial classs implementation.
1436 * attribute.cs (Attribute.Equal): Implemented.
1437 (Attribute.Emit): Changed as attributes can be applied more than twice.
1438 (Attributes.Emit): Check for duplicate attributes here.
1440 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1441 as a parameter, clean-up.
1443 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1447 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1448 contains obsolete attribute check which can in some cases look for base
1449 type of current class which is not initialized yet.
1450 (TypeContainer.BaseType): Replacement of ptype.
1452 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1454 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1456 First of prerequisites for new partial classs implemention.
1458 * attribute.cs (Attributable): Extended by ResolveContext;
1459 Attributes finally have correct context for resolving in all cases.
1460 (AttachTo): Attribute owner is assigned here.
1462 * codegen.cs (IResolveContext): Introduce new interface to hold
1463 all information needed in resolving phase.
1464 (EmitContext): Implements IResolveContext; more clean-up needed here.
1466 * decl.cs (MemberCore): Implemented IResolveContext.
1468 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1469 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1470 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1471 Refactored to use new IResolveContext instead of EmitContext; cleanup
1473 2006-03-22 Raja R Harinath <rharinath@novell.com>
1475 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1476 mcs to keep code differences small.
1477 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1478 * typemanager.cs (parameter_default_value_attribute_type): New.
1479 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1482 2006-03-22 Martin Baulig <martin@ximian.com>
1485 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1488 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1489 instead of the normal `NullLiteral'.
1491 2006-03-21 Martin Baulig <martin@ximian.com>
1494 * generic.cs (TypeManager.InferType): If `pt' is a generic
1495 parameter, don't check whether `pt == at'.
1497 2006-03-20 Raja R Harinath <rharinath@novell.com>
1500 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1501 (TypeParameter.Resolve): Update to change.
1502 (ConstraintChecker.CheckConstraints): Resolve type-argument
1503 constraints before use.
1505 2006-03-16 Martin Baulig <martin@ximian.com>
1508 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1509 and don't have any instance constructors, also lookup in the base class.
1510 (TypeManager.IsNullableValueType): New public method.
1512 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1513 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1514 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1516 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1517 instead of just TypeManager.IsNullableType() to determine whether
1518 a lifted operator exists.
1519 (UnaryMutator.DoResolve): Likewise.
1520 (Conditional.DoResolve): Likewise.
1521 (Binary.DoResolve): A lifted operator only exists if both operands
1522 are valuetypes and at least one of them is a nullable type.
1524 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1526 * iterator.cs : yield break is allowed in try statement which has
1527 catch clauses. Fixed bug #77767.
1529 2006-03-12 Martin Baulig <martin@ximian.com>
1531 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1532 private IsSignatureEqual() to compare types; see the comment in
1533 that method; fixes #77674.
1535 2006-03-10 Raja R Harinath <rharinath@novell.com>
1537 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1538 (Expression.ResolveAsTypeTerminal): Likewise.
1539 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1540 * expression.cs, generic.cs, iterators.cs: Likewise.
1541 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1543 2006-03-09 Martin Baulig <martin@ximian.com>
1545 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1546 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1548 2006-03-09 Martin Baulig <martin@ximian.com>
1550 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1551 `prepared' flag is set.
1553 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1554 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1555 issues; see gtest-254.cs.
1557 2006-03-07 Martin Baulig <martin@ximian.com>
1559 * generic.cs (TypeManager.InferType): Allow infering
1560 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1562 2006-03-06 Martin Baulig <martin@ximian.com>
1565 (TypeManager.InferType): Fix gtest-250.cs.
1568 (TypeManager.IsSubclassOf): Also check the base class.
1571 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1574 2006-03-01 Raja R Harinath <rharinath@novell.com>
1577 * expression.cs (ParameterReference.DoResolveBase): Change return
1579 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1583 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1586 * typemanager.cs (GetFullNameSignature): Don't nullref on
1587 protected accessors.
1589 2006-02-16 Martin Baulig <martin@ximian.com>
1592 (TypeManager.GetGenericFieldDefinition): New public method; use it
1593 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1595 2006-02-14 Martin Baulig <martin@ximian.com>
1597 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1599 2006-02-14 Martin Baulig <martin@ximian.com>
1602 (TypeManager.DropGenericMethodArguments): New public method; don't
1603 use GetGenericMethodDefinition() on something which is not a
1606 2006-02-14 Martin Baulig <martin@ximian.com>
1609 (ConstraintChecker.CheckConstraints): If a type parameter has the
1610 `struct' constraint, the type must be a non-nullable valuetype.
1612 2006-02-10 Martin Baulig <martin@ximian.com>
1615 (TypeManager.IsOverride): Make this work for instantiated methods
1616 in a generic class; fixes #77509.
1617 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1618 rather than calling it directly; fixes #77488.
1620 2006-02-08 Martin Baulig <martin@ximian.com>
1622 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1623 reporting into CheckConstraint() so we can use the correctly
1626 2006-02-08 Martin Baulig <martin@ximian.com>
1628 * expression.cs (BaseAccess): Add support for generic methods.
1630 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1631 the new MethodGroupExpr.
1633 2006-02-07 Martin Baulig <martin@ximian.com>
1635 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1636 also reference types; fixes #77483.
1638 2006-02-07 Martin Baulig <martin@ximian.com>
1641 (TypeManager.IsGenericMethod): We now return whether something is
1642 an instantiated generic method (and not a generic method def).
1643 (TypeManager.IsGenericMethodDefinition): New public method.
1646 (TypeManager.CSharpSignature): Only include type arguments for
1647 "real" generic methods, not for any instantiated method.
1648 (TypeManager.GetMethodName): Likewise, but also allow generic
1649 method definitions here.
1651 2006-02-06 Miguel de Icaza <miguel@novell.com>
1653 * codegen.cs (EmitScopeInitFromBlock): check here the
1654 capture_context, there is no need to make two calls to the
1657 * anonymous.cs: Add some debugging messages that might help me
1658 track other instances of this problem in the future (the
1659 regression of test 467).
1661 * cs-parser.jay: track the variable block, as we need to initalize
1662 any captured variables declared in this block for the "catch"
1663 portion of the "Try" statement.
1665 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1666 scope initialization for captured variables.
1668 Also, move the emit for the variables after the block location has
1671 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1673 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1675 2006-02-06 Martin Baulig <martin@ximian.com>
1677 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1678 `TypeManager.value_type' as parent type to
1679 ModuleBuilder.DefineType(). Fixes #77358.
1681 2006-02-02 Miguel de Icaza <miguel@novell.com>
1683 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1684 commit yesterday, the initialization for the roots is necessary.
1685 What is not necessary is the scope activation.
1687 2006-02-02 Raja R Harinath <rharinath@novell.com>
1689 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1690 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1692 (Argument.Resolve): Remove CS0206 checks.
1694 2006-02-01 Miguel de Icaza <miguel@novell.com>
1696 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1697 scopes for all the roots, the scopes will now be emitted when the
1698 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1700 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1701 code. This reduces a lot of existing cruft.
1703 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1704 that the ScopeInfo is generated as we enter the scope, not at the
1705 time of use, which is what we used to do before.
1707 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1708 every time a Block is about to be emitted if we have a
1711 2006-02-01 Raja R Harinath <rharinath@novell.com>
1713 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1714 attribute for mscorlib too.
1716 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1718 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1720 * typemanager.cs (cons_param_array_attribute): Make private.
1721 (Reset): Set it to null.
1722 (InitCoreHelpers): Don't initialize it.
1723 (ConsParamArrayAttribute): New. Initialize it as needed.
1724 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1726 2006-01-31 Miguel de Icaza <miguel@novell.com>
1728 * expression.cs: There might be errors reported during the
1729 selection of applicable methods. If there are errors, do not
1730 continue execution as it will lead the compiler to crash.
1732 2006-01-30 Miguel de Icaza <miguel@novell.com>
1734 * expression.cs: Member access is not allowed on anonymous
1735 methods. Fixes #77402.
1737 2006-01-30 Raja R Harinath <rharinath@novell.com>
1740 * cs-parser.jay (VariableDeclaration): Don't set
1741 current_array_type to null.
1742 (field_declaration, event_declaration, declaration_statement):
1743 Set it to null here.
1745 2006-01-29 Raja R Harinath <harinath@gmail.com>
1748 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1750 2006-01-28 Raja R Harinath <harinath@gmail.com>
1752 * typemanager.cs (GenericParameterPosition): New.
1755 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1757 * doc.cs : To process "include" elements, first we should create
1758 another list than XmlNodeList, because it could result in node
1759 removal, which could result in that the XmlNodeList gives up
1762 2006-01-25 Miguel de Icaza <miguel@novell.com>
1764 * expression.cs: Introduce an error report that we were not
1765 catching before. Gonzalo ran into it.
1767 2006-01-23 Miguel de Icaza <miguel@novell.com>
1769 A fix for bug: #76957
1771 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1772 ComputeMethodHost before creating the method, this is a new
1775 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1776 that this method references (RegisterScope). The actual scope
1777 where the method is hosted is computed with the ComputeMethodHost
1778 before we create the method.
1780 Moved the Deepest routine here.
1782 (AnonymousContainer.ComputeMethodHost): New routine used to
1783 compute the proper ScopeInfo that will host the anonymous method.
1785 (ScopeInfo): Deal with multiple roots. The problem was that we
1786 did not have a unique root where all ScopeInfos could be hanged
1787 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1790 Remove AdjustMethodScope which is now computed at the end. Remove
1791 LinkScope which did a partial link, instead link all ScopeInfos
1792 before code generation from the new "LinkScopes" routine.
1794 Simplify all the Add* routines as they no longer need to maintain
1795 the tree, they just need to record that they are using variables
1798 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1799 routines to produce the forest of ScopeInfo trees.
1801 * class.cs (TypeContainer.AppendMethod): This is just like
1802 AddMethod, but ensures that an interface implementation method
1803 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1804 methods, but at the end.
1806 We use this functionality to ensure that the generated MoveNext
1807 method in the iterator class is resolved/emitted before the
1808 enumerator methods created.
1810 This is required because the MoveNext method computes the right
1811 ScopeInfo for the method. And the other methods will eventually
1812 need to resolve and fetch information computed from the anonymous
1816 2006-01-23 Raja R Harinath <rharinath@novell.com>
1818 Improve implementation of section 14.4.2.2 (Better function member).
1819 * expression.cs (Invocation.MoreSpecific): Compare all type
1820 arguments before deciding if one type is more specific than
1821 another. Handle array types too. Return the more specific type.
1822 (Invocation.BetterFunction): Add more tie-breaking rules from
1823 section 14.4.2.2. Perform "more specific" check after
1824 other tie-breaking rules. Compare all parameter types before
1825 choosing the "more specific" method.
1827 2006-01-21 Raja R Harinath <harinath@gmail.com>
1828 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1831 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1833 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1834 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1836 2006-01-18 Martin Baulig <martin@ximian.com>
1838 * class.cs (TypeContainer.AddToMemberContainer): Use
1839 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1842 2006-01-18 Martin Baulig <martin@ximian.com>
1844 Fix #76417: a generic class may now have methods which may unify
1845 for some type parameter substitutions.
1847 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1848 for methods which may unify anymore.
1850 * expression.cs (Invocation.MoreSpecific): New private static
1851 method; checks whether one method is more specific than another
1852 according to 14.4.2.2 of the spec.
1853 (Invocation.BetterFunction): Implement the tie-breaking rules from
1854 14.4.2.2 of the spec: if two methods unify for some type parameter
1855 substitution, we need to pick the more specific one.
1857 2006-01-18 Raja R Harinath <rharinath@novell.com>
1859 Fix #76656, cs0231-2.cs.
1860 * cs-parser.jay (formal_parameter_list): Make error case catch
1862 (parenthesized_expression_0): Add CS1026 check.
1863 (invocation_expression): Remove unused { $$ = lexer.Location }.
1865 2006-01-17 Raja R Harinath <rharinath@novell.com>
1868 * cs-parser.jay (statement_expression): Don't list out the
1869 individual statement-expressions. Convert syntax error into
1872 2006-01-16 Raja R Harinath <rharinath@novell.com>
1875 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1876 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1877 CheckIntermediateModification.
1878 (FieldExpr.DoResolve): Add new two-argument version that
1879 allows us to resolve the InstanceExpression as an lvalue.
1880 The one-argument variant is now just a wrapper.
1881 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1882 Resolve the lhs as an lvalue if the it has a value type.
1883 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1884 from Assign.DoResolve.
1885 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1886 resolved as an lvalue.
1887 (PropertyExpr.DoResolve): Update.
1888 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1889 has a value type. Move CS1612 check here from
1890 CheckIntermediateModification.
1891 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1892 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1893 'right_side' of a ResolveLValue on an 'out' argument.
1894 (EmptyExpression.LValueMemberAccess): New. Used as the
1895 'right_side' of a propagated ResolveLValue on a value type.
1896 (LocalVariableReference.DoResolveBase): Recognize
1897 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1899 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1900 EmptyExpression.Null.
1902 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1904 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1905 Type.IsGenericParameter(). Fixed bug #77183.
1906 * doc.cs : it is now identical to doc.cs in mcs.
1908 2006-01-16 Martin Baulig <martin@ximian.com>
1910 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1912 2006-01-16 Martin Baulig <martin@ximian.com>
1914 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1915 ctors; fixes #77250.
1917 2006-01-12 Miguel de Icaza <miguel@novell.com>
1919 This fixes the problem where we used ldfld instead of ldflda to
1920 load the "THIS" pointer on captured parameters, when THIS is a
1921 value type. See bug #77205.
1923 * iterators.cs (CapturedThisReference.Emit): Pass false to
1924 EmitThis (we do not need the address).
1926 * codegen.cs (EmitThis): it needs to know whether we need the
1927 address of `this' or not. This is used by value types.
1929 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1930 every other call passes false.
1932 2006-01-12 Raja R Harinath <rharinath@novell.com>
1935 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1937 * expression.cs (Invocation.OverloadResolve): Update.
1938 (Invocation.DoResolve): Avoid double resolution of invocation.
1940 2006-01-11 Raja R Harinath <rharinath@novell.com>
1943 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1944 unary negation of floating point types as 0-expr; negation cannot
1945 overflow in floating point types.
1948 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1949 on operands of 'void' type.
1952 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1953 and ExclusiveOr for boolean constants too.
1955 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1957 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1959 2006-01-12 Miguel de Icaza <miguel@novell.com>
1961 * cs-tokenizer.cs (Position): New class used to save and restore
1962 the position state in the tokenizer. Before this patch the save
1963 and restore was not complete enough so the line and columns would
1964 start to drift and the debugger and stack traces will get the
1967 2006-01-10 Martin Baulig <martin@ximian.com>
1970 (TypeParameter.InflateConstraints): New public method.
1972 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1973 constraints; fixes #77042.
1975 2006-01-10 Martin Baulig <martin@ximian.com>
1977 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1978 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1981 2006-01-09 Raja R Harinath <rharinath@novell.com>
1984 * expression.cs (Invocation.OverloadResolve): Replace reflected
1985 override methods with their base virtual methods, rather than
1987 * typemanager.cs (TypeManager.GetOverride): New.
1989 2005-12-21 Miguel de Icaza <miguel@novell.com>
1991 * driver.cs: Report the case of no source files and no -out:
1994 2005-12-20 Raja R Harinath <rharinath@novell.com>
1997 * expression.cs (ComposedCast.GetSignatureForError): Define.
1999 2006-01-05 Jb Evain <jbevain@gmail.com>
2001 * class.cs (Property.Define, Indexer.Define): do not tag the
2002 properties as SpecialName | RTSpecialName.
2004 2006-01-04 Miguel de Icaza <miguel@novell.com>
2006 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2007 doing a low-level comparission of parameter types. It was lacking
2008 a check for __argslist.
2010 2005-12-30 Miguel de Icaza <miguel@novell.com>
2012 * expression.cs (ParameterReference.DoResolveBase): Allow
2013 reference parameters if they are local to this block.
2015 This allows the ref and out parameters of a delegate to be used in
2016 an anonymous method, for example:
2018 delegate void set (out int x);
2020 set s = delegate (out int x){
2024 This is used by functionality introduced late in the C# language.
2026 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2027 method that take ref and out parameters.
2029 Fixes #77119 which was a late change in the spec.
2031 2005-12-23 Miguel de Icaza <miguel@novell.com>
2033 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2034 parent if its the same scope. Fixes #77060.
2036 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2038 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2040 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2042 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2043 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2044 that doesn't contain the full public key. This is a update of the
2045 friend assemblies in .Net 2.0 release.
2047 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2051 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2052 ListDictionary, to contain the ExternAliasEntry entries (in
2053 addition to the NamespaceEntry.aliases hashtable). This field is
2054 shared between the original entry and its doppelganger (bodyless
2056 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2057 extern_aliases field.
2058 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2059 lookup in extern_aliases.
2061 2005-12-16 Raja R Harinath <rharinath@novell.com>
2064 * class.cs (TypeContainer.Mark_HasEquals): New.
2065 (TypeContainer.Mark_HasGetHashCode): New.
2066 (ClassPart): Override them.
2067 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2069 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2070 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2074 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2075 'parent' argument to the base constructor.
2077 Remove all mention of TypeContainer from decl.cs.
2078 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2079 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2080 (DeclSpace.DeclSpace): Likewise.
2081 (DeclSpace.DefineMembers): Remove unused argument.
2082 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2083 debugging check -- we don't care if the debug code throws an
2084 InvalidCastException instead of an InternalErrorException.
2085 * class.cs (TypeContainer.DefineMembers): Update to changes.
2086 (TypeContainer.DoDefineMembers): Likewise.
2087 (TypeContainer.GetMethods): Likewise.
2088 (PropertyMember.Define): Likewise.
2089 (MemberBase.Parent): New property that forwards to
2090 MemberCore.Parent, but ensures that we get a TypeContainer.
2091 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2092 (RootContext.PopulateTypes): Likewise. Remove special case code
2093 for !RootContext.StdLib: DefineMembers is idempotent.
2095 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2097 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2099 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2101 * doc.cs : The search for referenced namespace was insufficient to
2102 get global one as it used to do. Fixed bug #76965.
2104 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2106 * doc.cs : check name in cref in the last phase that whether it is
2109 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2111 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2114 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2116 * doc.cs : so it turned out that we cannot skip override check for
2117 interface members. Fixed bug #76954.
2119 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2121 * cs-tokenizer.cs : fixed bug #75984:
2122 - #warning and #error should not be handled when the source line
2124 - #line is not checked strictly when the source line is disabled.
2125 - #define and #undef is on the other hand checked strictly at any
2128 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2130 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2133 2005-12-15 Raja R Harinath <rharinath@novell.com>
2135 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2137 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2140 2005-12-14 Martin Baulig <martin@ximian.com>
2142 * typemanager.cs (TypeManager.GetFullName): Make this public;
2143 `Type.Fullname' now never returns null.
2145 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2146 explicit interface implementations; we're now using the same
2147 naming convention than csc does.
2149 2005-12-14 Miguel de Icaza <miguel@novell.com>
2151 * convert.cs (ExplicitConversionCore): Check the return value from
2152 ExplicitConversionCore which can return null on failure. Fixes #76914
2154 2005-12-09 Raja R Harinath <rharinath@novell.com>
2156 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2157 instead of IsGenericInstance.
2158 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2159 code that's now covered by the more general test.
2160 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2162 * generic.cs (DropGenericTypeArguments): New. Captures the common
2163 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2164 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2165 * generic.cs, report.cs, typemanager.cs: Likewise.
2167 2005-12-08 Martin Baulig <martin@ximian.com>
2169 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2171 * typemanager.cs (TypeManager.CSharpSignature): Include type
2172 arguments in the signature of a generic method.
2174 2005-12-07 Martin Baulig <martin@ximian.com>
2176 Add support for custom attributes on type parameters.
2178 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2180 * generic.cs (TypeParameterName): New public class; we use this
2181 instead of a `string' to store the name of a type parameter, so we
2182 can also have `Attributes'.
2183 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2184 array instead of a `string[]' array.
2185 (TypeParameter.ctor): We now also take an `Attributes' argument.
2186 (TypeParameter.EmitAttributes): New public method; emit our
2187 `OptAttributes' here.
2188 (GenericMethod.EmitAttributes): New public method; emit the custom
2189 attributes on all our type parameters.
2191 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2192 our type parameters.
2193 (MethodData.Define): If we're a generic method, call
2194 EmitAttributes() on it.
2196 2005-12-07 Martin Baulig <martin@ximian.com>
2199 (ConstraintChecker): New public abstract class; move the
2200 constraint checking here from `ConstructedType' and also do
2201 constraint checking for generic methods here.
2203 * expression.cs (Invocation.OverloadResolve): Use
2204 ConstraintChecker.CheckConstraints() if we resolved to a generic
2207 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2209 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2211 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2213 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2214 (FieldBase.Initializer): Initializer is now optional.
2215 (EventField.Define): Only event field can have initializer.
2217 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2219 * const.cs (Const): Reuse initializer.
2221 * cs-parser.jay: Updated after FieldBase changes.
2222 Added current_array_type to simplify array initializers.
2224 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2226 * expression.cs, iterators.cs: Updated.
2228 * namespace.cs (NamespaceEntry): Made UsingFound private.
2230 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2232 * parameterCollection.cs: Obsolete, removed.
2233 * parser.cs: Obsolete, removed.
2235 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2238 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2240 * enum.cs (Enum.Define): Set obsolete context here.
2242 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2245 - FindDocumentedMember() now expects 1) paramList as null
2246 when "we don't have to check the number of parameters" and
2247 2) Type.EmptyTypes when "there is no arguments".
2248 - Introduced FoundMember struct to hold the exact type which was
2249 used to find the documented member (the above change broke
2250 test-xml-044; it might be better just to use DeclaringType than
2251 what MS does, like this change does, but it depends on usage.)
2253 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2255 * doc.cs : documented member might be from DeclaringType for nested
2256 types. Fixed bug #76782.
2258 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2260 * anonymous.cs: Have the param code handle leaving copies on the
2261 stack etc. Allows anonymous params to take part in the assignment
2262 code (++, +=, etc). Fixes bug #76550
2264 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2265 it down to the anon code.
2267 * iterators.cs: Use dummy var here
2269 * codegen.cs: Handle new vars
2271 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2274 * class.cs (MethodData.Define): Set proper Obsolete context.
2276 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2278 (FieldExpr.DoResolve): Ditto.
2280 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2283 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2284 parent is not obsolete.
2286 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2288 * doc.cs : (FindDocumentedMember) find parameterless members first
2289 and get CS0419 in the early stage. Fixed first case of bug #76727.
2291 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2294 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2295 no error was reported.
2297 *expression.cs (Binary.DoResolve): left can be null.
2299 2005-12-06 Raja R Harinath <rharinath@novell.com>
2301 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2302 abstract method and all overrides.
2303 * support.cs (ParameterData.GenericConstraints): Delete.
2304 (ReflectionParameters.type_params): Delete.
2305 (ReflectionParameters.ReflectionParameters): Make private.
2306 (ReflectionParameters.GetConstaints): New factory method.
2307 * generic.cs (TypeParameterDefineType): Use it.
2308 (TypeManager.GetTypeParameterConstraints): Likewise.
2310 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2313 * class.cs (MethodData.Emit): Parameters should be labeled first.
2315 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2318 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2320 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2322 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2324 * class.cs (MethodCore): Parameter clean up.
2325 (IMethodData): Added ParameterInfo.
2326 (MethodData): Parameter clean up.
2327 (Indexer.Define): Parameter clean up.
2339 * typemanager.cs: Parameter clean up.
2341 * delegate.cs (Define): Get rid of duplicated code.
2343 * expression.cs (ParameterReference): Removed useless parameters
2345 (Invocation): Ditto.
2347 * parameter.cs (ParamsParameter): New class, params specialization.
2348 (ArglistParameter): Attemp to separate arglist.
2349 (Parameter): Refactored to be reusable and faster.
2350 (Parameter.Modifier): Made understandable.
2351 (Parameters): Changed to be used as a class for `this' assembly
2352 parameters. Refactored to use new specialized classes.
2354 * support.cs (ParameterData): Added Types property.
2355 (InternalParameters): Deleted.
2357 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2359 * doc.cs : the previous patch does not actually fix the bug.
2360 PropertyInfo override check is now implemented and really fixed it.
2361 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2363 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2365 * doc.cs : apply "override filter" also to properties.
2368 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2370 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2371 no need to check overrides. For classes, omit those results from
2372 interfaces since they must exist in the class. Fixed bug #76726.
2374 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2376 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2377 with different parameters. Fixed the second problem in #76685.
2379 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2381 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2382 get expected 'protected' access in CheckValidFamilyAccess()).
2385 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2387 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2388 Fixed bug #76705. CS1569 was incorrectly commented out.
2390 2005-11-23 Martin Baulig <martin@ximian.com>
2392 * generic.cs (Constraints.Define): Removed.
2393 (TypeParameter.DefineConstraints): Removed.
2394 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2395 on the GenericTypeParameterBuilder here.
2397 2005-11-23 Martin Baulig <martin@ximian.com>
2399 * typemanager.cs (TypeManager.GetProperty): Make this public.
2401 * generic.cs (Nullable.NullableInfo.ctor): Use
2402 TypeManager.GetProperty() rather than using reflection directly.
2404 2005-11-17 Martin Baulig <martin@ximian.com>
2406 * expression.cs (Indexers.GetIndexersForType): Added support for
2407 generic parameters; fixes #76587.
2409 2005-11-17 Martin Baulig <martin@ximian.com>
2412 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2413 inherit the scope from our parent. Fixes #76653.
2415 2005-11-15 Martin Baulig <martin@ximian.com>
2417 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2418 instead of `ScopeTypeBuilder' to refer to the "current" type.
2419 (AnonymousMethod.CreateScopeType): Correctly create the helper
2420 class if we're inside a generic type definition.
2422 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2424 * doc.cs : use Invocation.IsOverride() to do real override check.
2425 * expression.cs : made Invocation.IsOverride() internal.
2427 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2429 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2430 TypeBuilder.FindMembers() and filter overriden base members out.
2433 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2435 * doc.cs : ref/out parameters are represented as '@' (instead of
2436 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2438 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2440 * doc.cs : when there was no '.' in cref to methods in doc comment,
2441 then parameters were missing in the output. Fixed bug #76691.
2443 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2445 * driver.cs : don't output docs when there is an error.
2448 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2451 Now it should detect indexers. Fixed primary concern in bug #76685.
2452 Fixed CS0419 message to not show the identical member signature in
2455 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2457 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2458 instead of Type.FindMembers() since it does not handle events.
2461 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2463 * codegen.cs: Fixed typo (speficied -> specified).
2465 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2468 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2470 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2472 * attribute.cs: Changed error message.
2474 * cs-tokenizer.cs: One more check.
2476 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2478 * statement.cs (Block.Resolve): Ignore empty statement.
2480 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2482 * report.cs: Made error/warning methods more strict to avoid
2485 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2486 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2487 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2488 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2490 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2492 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2493 Use the more explicit AssemblyName.FullName instead of
2494 AssemblyName.Name to report errors.
2496 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2498 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2501 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2511 * report.cs: Fixed error reporting and typos.
2513 * generic.cs (TypeParameter.GetSignatureForError): New method.
2514 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2516 * typemanager.cs (GetFullName): Refactored.
2518 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2520 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2521 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2523 * class.cs (TypeContainer.IsComImport): New property.
2524 (Constructor.Define): Create proper ctor for ComImport types.
2526 * expression.cs (New.CheckComImport): Fixed.
2528 2005-11-07 Miguel de Icaza <miguel@novell.com>
2530 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2531 that a parameter has been captured does not mean that we do not
2532 have to do the rest of the processing. This fixes the second part
2533 of #76592. If there was another anonymous method capturing
2534 values in the past, the Scope would never be set for the second
2535 method that captured the same parameter.
2537 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2538 properly manipulate the stack. Second part of fix for #76592.
2540 * expression.cs (New): Add support for invoking "new" on
2541 interfaces that have been flagged with the ComImport attribute and
2542 the CoClass. Fixes #76637
2544 * statement.cs (Try.DoEmit): When a variable is captured, do not
2545 try to emit the vi.LocalBuilder variable as it has been captured.
2546 Create a temporary variable and store the results on the
2547 FieldBuilder. Fixes #76642
2549 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2551 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2553 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2555 * expression.cs (Binary.DoResolve): Added && optimalization.
2557 * typemanager.cs (AddUserType): Removed useless argument.
2559 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2561 * statement.cs (Block.variables): Uses ListDictionary.
2563 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2566 * class.cs (PartialContainer.EmitType): Customized to emit
2567 security attributes.
2568 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2569 for partial classes.
2571 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2574 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2575 access has to be fixed.
2577 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2579 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2582 * ecore.cs (NullCast.Reduce): Implemented.
2584 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2587 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2589 (Foreach.Resolve): Catch null properly.
2591 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2593 * cs-tokenizer.cs: Warning text fix.
2595 * driver.cs: AllWarningNumbers exposed on public interface.
2597 * report.cs (): Reviewed warning numbers.
2598 (IsValidWarning): Use binary search.
2600 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2602 * driver.cs: Implemeted resource visibility.
2603 (Resources): New class for code sharing between /res: and
2606 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2608 decl.cs (CurrentTypeParameters): Fixed to be public.
2610 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2612 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2614 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2616 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2618 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2620 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2622 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2624 Add friend assembly access support.
2625 * typemanager.cs: assembly_internals_vis_attrs
2626 cache for friend assembly access.
2627 (TypeManager.IsFriendAssembly): New method for
2628 checking friend assembly access.
2629 (TypeManager.Error_FriendAccessNameNotMatching): New
2631 (TypeManager.CompareKeyTokens): Likewise.
2632 (TypeManager.Filter): Handle friend accessible
2635 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2636 friend accessible types.
2638 * ecore.cs (Expression.IsAccessorAccessible): Handle
2639 friend accessible properties.
2641 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2644 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2647 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2650 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2653 * ecore.cs (NullCast): Child is contant only.
2655 * literal.cs (NullLiteral.Reduce): null can be converted to any
2658 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2660 * driver.cs: Use Encoding.Default as default code page instead
2663 2005-10-27 Raja R Harinath <rharinath@novell.com>
2666 * expression.cs (Invocation.Error_InvalidArguments): Handle
2667 __arglist parameters.
2668 (Invocation.VerifyArgumentsCompat): Likewise.
2669 * support.cs (ReflectionParameters.GetSignatureForError): Print
2670 __arglist parameters.
2671 (InternalParamters.GetSignatureForError): Likewise.
2672 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2674 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2676 * attribute.cs (GetPropertyValue): Made public.
2678 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2680 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2682 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2685 * driver.cs: Reflect method name change.
2687 * statement.cs (Try.Resolve): Warn when try has both general
2690 * typemanager.cs: runtime_compatibility_attr_type new predefined
2693 2005-10-26 Raja R Harinath <harinath@gmail.com>
2696 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2697 treat it as an empty parameter list.
2699 2005-10-26 Raja R Harinath <rharinath@novell.com>
2702 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2703 ResolveAsTypeStep silent.
2704 * statement.cs (Block.AddConstant): Mark block as used.
2705 (Block.ResolveMeta): Avoid piling on error messages
2706 if a constant initializer resolution fails.
2708 2005-10-25 Raja R Harinath <rharinath@novell.com>
2710 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2712 (NamespaceEntry.VerifyAllUsing): New.
2713 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2714 behaviour. Delegates actual resolution of alias to ...
2715 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2716 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2718 * driver.cs (Driver.MainDriver): Update.
2720 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2721 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2723 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2725 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2726 RootNamespace.DefineNamespacesForAll.
2728 2005-10-24 Raja R Harinath <harinath@gmail.com>
2730 * typemanager.cs (assemblies, external_aliases, modules)
2731 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2732 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2733 overhead. Move resposibility ...
2734 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2735 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2737 2005-10-23 Raja R Harinath <harinath@gmail.com>
2739 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2740 cached_namespaces. Improve usage.
2741 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2742 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2743 Move from GlobalRootNamespace and simplify.
2744 (RootNamespace.Global): Make instance variable.
2745 (RootNamespace.RootNamespace): Add "alias name" parameter.
2746 (GlobalRootNamespace): Simplify drastically.
2747 (Namespace.Lookup): Don't use GetNamespace.
2748 * typemanager.cs (GetRootNamespace): Rename from
2749 ComputeNamespaceForAlias.
2750 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2752 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2754 * anonymous.cs (AnonymousContainer): Don't crash when container
2757 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2759 * expression.cs (Binary.DoResolve): Warn when comparing same
2762 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2765 * expression.cs (Binary.DoResolve): It looks like there are no
2766 convetsion rules in enum context.
2768 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2770 Add support for extern alias qualifiers.
2771 * typemanager.cs: Move some LookupTypeReflection code
2772 to namespace.cs, to have cleaner code. Added some methods
2773 to help us keep track of the extern aliased references.
2774 * driver.cs: Add suport for extern alias assemblies on command
2775 line and check for their warnings/errors. Also keep track of the
2776 extern aliased assemblies.
2777 * namespace.cs: Move the global functionality of Namespace
2778 to GlobalRootNamespace/RootNamespace. Now the global namespace
2779 is GlobalRootNamespace.Globa. Also the code moved from
2780 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2781 Finally added LocalAliasEntry (AliasEntry before) and
2782 ExternAliasEntry, to handle alias statements.
2783 * cs-parser.jay: Add support in the grammar for extern alias
2785 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2786 Update callings to Namespace (now in GlobalRootNamespace).
2788 2005-10-25 Martin Baulig <martin@ximian.com>
2790 * convert.cs (ImplicitTypeParameterConversion): Make base
2791 interfaces actually work; fixes #76557.
2793 2005-10-25 Martin Baulig <martin@ximian.com>
2796 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2797 all the type parameters; fixes #76551.
2799 2005-10-25 Martin Baulig <martin@ximian.com>
2804 (GenericMethod.ctor): Added `Expression return_type' and
2805 `Parameters parameters' arguments.
2806 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2807 parameter and return types to check their constraints if they're
2810 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2813 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2814 constraints of a generic type if `ec.ResolvingGenericMethod'.
2816 * class.cs (MethodCore.DoDefineParameters): Set
2817 `ec.ResolvingGenericMethod' if we're a generic method.
2818 (MemberBase.MemberType): Likewise.
2820 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2822 * typemanager.cs (TypeManager): Added
2823 TypeManager.internals_visible_attr_type to cache
2824 S.R.CompilerServices.InternalsVisibleToAttribute.
2826 * codegen.cs (AssemblyClass): Added checks for
2827 InternalsVisibleToAttribute in new method
2828 CheckInternalsVisibleAttribute () and also cache the
2829 AssemblyName in AssemblyClass.Name.
2831 2005-10-24 Martin Baulig <martin@ximian.com>
2834 (TypeManager.ExpandInterfaces): Added overloaded version which
2835 just takes a `Type[]' array.
2838 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2839 just use the interfaces which were explicitly specified and not
2840 the interfaces they inherit. Fixes #76482.
2841 (TypeParameter.FindMembers): Expand the interfaces here.
2843 2005-10-21 Martin Baulig <martin@ximian.com>
2846 (Constraints.Resolve): Also resolve the actual types here.
2847 (Constraints.ResolveTypes): Just check the constraints here.
2848 Fixes #76363; see gtest-218.cs.
2850 2005-10-21 Martin Baulig <martin@ximian.com>
2853 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2854 instead of a `BoxedCast'; fixes gtest-217.cs.
2856 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2858 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2859 1) "new()" is specified as generic parameter constraint and 2) the
2860 type is TypeBuilder and 3) the type is abstract even if it has a
2861 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2863 2005-10-20 Martin Baulig <martin@ximian.com>
2866 (GenericConstraints.TypeParameter): New public property.
2867 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2868 (TypeParameter.DeclSpace): New public property.
2869 (TypeParameter.DefineType): Inflate the constraints if our
2870 `DeclSpace' is an `Iterator'.
2872 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2874 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2875 GenericMethod argument to compare methods' generic type arguments.
2878 2005-10-19 Martin Baulig <martin@ximian.com>
2880 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2881 not ResolveType() when resolving the base type, so we're not
2882 checking the constraints here.
2883 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2886 2005-10-19 Martin Baulig <martin@ximian.com>
2888 * generic.cs (ConstructedType.CheckConstraints): Committing
2889 untested fix for #76441.
2891 2005-10-18 Raja R Harinath <rharinath@novell.com>
2894 * class.cs (TypeContainer.DefineType): Move updating of
2895 topological sort earlier in the code.
2896 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2898 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2901 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2903 * constant.cs (Constant.TryReduce): Moved from Cast class.
2904 (Reduce): Made little bit more OO and fixed missing conversions.
2906 * ecore.cs (Reduce): Implemented.
2907 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2909 * literal.cs (Reduce): Implemented.
2911 * class.cs: Reverted Miguel's wrong commit.
2913 2005-10-14 Miguel de Icaza <miguel@novell.com>
2915 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2917 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2919 * cs-parser.jay, expression.cs : CS0214 was missing error location
2920 for constants. Fixed bug #76404.
2922 2005-10-10 Raja R Harinath <rharinath@novell.com>
2924 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2926 (PropertyExpr.EmitCall): Likewise.
2927 * expression.cs (Invocation.EmitArguments): Handle case where
2929 (Invocation.EmitCall): Avoid allocating temporary variable if
2930 there are no arguments.
2932 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2935 * convert.cs (ExplicitConversionCore): Fixed object->enum
2938 2005-10-07 Raja R Harinath <rharinath@novell.com>
2941 * convert.cs (ImplicitConversionStandard): Move conversion of
2942 void* to arbitrary pointer types ...
2943 (ExplicitConversionStandard): .. here.
2944 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2945 error to always print typenames.
2947 2005-10-07 Raja R Harinath <rharinath@novell.com>
2949 * convert.cs (GetConversionOperator): Rename from
2950 GetConversionOperators. Move operator selection code from ...
2951 (UserDefinedConversion): ... here.
2953 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2955 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2958 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2960 * assign.cs (Assign.DoResolve): Error method changed.
2962 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2964 * const.cs (ResolveValue): Reset in_transit immediately.
2966 * constant.cs: Error method changed.
2968 * convert.cs: Removed useless location parameter.
2969 (ExplicitNumericConversion): Don't do double enum check.
2970 (ExplicitConversionCore): Renamed from ExplicitConversion.
2971 (ExplicitUnsafe): Extracted from ExplicitConversion.
2972 (ExplicitConversion): Uses for error reporting.
2974 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2976 (ResolveBoolean): Uses common error method.
2977 (CastToDecimal): Get rid of ec.
2978 (CastFromDecimal): Optimized.
2979 (ConvCast): Get rid of ec.
2981 * enum.cs (ResolveValue): Reset in_transit immediately.
2982 (Emit): Return after first error.
2984 * expression.cs: Convert changes.
2986 * literal.cs: Error method changed.
2988 * statement.cs: Error method changed.
2990 2005-10-06 Raja R Harinath <rharinath@novell.com>
2992 Fix gtest-131.cs and gtest-211.cs.
2993 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2994 Only emit code for a label if it is used. Unreachable code can
2995 violate ECMA evaluation stack invariants.
2997 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2999 * anonymous.cs: Implemented ExprClassName.
3001 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3004 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3007 * class.cs (StaticClass.DefineContainerMembers): Report protected
3010 * codegen.cs: if(ed) PRODUCTION.
3012 * convert.cs (Error_CannotImplicitConversion): Better error
3015 * cs-parser.jay: More error checks.
3017 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3019 * driver.cs (CSCParseOption): Enabled wrong option check.
3021 * ecore.cs (Expression.ExprClassName): Turned to property.
3022 (MemberExpr.CheckIntermediateModification): For checking boxed
3023 value types modification.
3025 * statement.cs (Fixed.Resolve): Expression type must be
3026 convertible to fixed type.
3027 (CollectionForeach.GetEnumeratorFilter,TryType):
3028 Small refactoring for easier error checking.
3030 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3032 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3035 * class.cs (GeneratedBaseInitializer): New class for customization
3036 compiler generated initializers.
3037 (MemberBase.DoDefine): Check Obsolete attribute here.
3038 (FieldMember.DoDefine): Ditto.
3040 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3043 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3044 (MemberCore.GetObsoleteAttribute): Removed argument.
3045 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3046 (MemberCore.CheckObsoleteType): New helper.
3050 * statement.cs: Updates after MemberCore changes.
3052 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3053 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3055 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3056 obsolete attribute for compiler construct.
3057 (As.DoResolve): Cache result.
3059 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3061 2005-10-01 Miguel de Icaza <miguel@novell.com>
3063 * expression.cs (Probe): instead of having a "Type probe_type"
3064 keep the extra information as a TypeExpr probe_type_expr since the
3065 "As" operator needs to perform some type checks.
3067 * (As.DoResolve): If the type is a type parameter, ensure that it
3068 is constrained by a class.
3070 2005-09-22 Miguel de Icaza <miguel@novell.com>
3072 * statement.cs (Lock): Use the TemporaryVariable class instead of
3073 manually using local variables as those do not work when variables
3076 * ecore.cs: Moved the TemporaryVariable class from being a nested
3077 class inside Foreach to be a public class that can be employed in
3080 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3082 * cs-parser.jay: interface_accessors replaced by
3083 accessor_declarations.
3085 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3088 * statement.cs (GotoCase.Resolve): Convert null constant to
3090 (SwitchLabel.ResolveAndReduce): Ditto.
3091 (SwitchLabel.NullStringCase): Custom null stamp.
3092 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3094 typemanager.cs (CSharpSignature): Don't skip first argument
3097 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3099 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3100 expression.cs, iterators.cs, literal.cs: Store constants and
3103 * class.cs (MemberBase.ShortName): Pass location.
3105 * cs-parser.jay: Some location fixes.
3107 * ecore.cs (Expression.Location): Made virtual.
3109 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3112 * const.cs (Const.ResolveValue): Check for assigning non-null
3113 value to reference type.
3115 2005-09-26 Raja R Harinath <rharinath@novell.com>
3118 * expression.cs (This.VerifyFixed): In a value type T, the type of
3119 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3120 value type R, 'this' is treated as a value parameter.
3122 2005-09-05 Miguel de Icaza <miguel@novell.com>
3124 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3125 if the underlying types are the same, otherwise we need to produce
3126 code that will do the proper cast.
3128 This was exposed by Marek's constant rewrite which produced
3129 invalid code for the call site:
3132 void Method (X v) {}
3136 This fixes test-49.cs
3138 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3140 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3141 Type/Object should be allowed as well. Fixed bug #75968.
3143 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3145 * expression.cs : (Binary.DoResolve): when one is enum constant and
3146 another is constant 0, then return enum one *as enum type*.
3149 2005-10-04 Martin Baulig <martin@ximian.com>
3151 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3152 `SetMemberIsUsed()' work for generics, too.
3154 2005-10-04 Martin Baulig <martin@ximian.com>
3156 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3157 for corlib. Fixes #75691.
3159 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3162 * driver.cs: Fix compilation files with full root path.
3164 2005-09-25 Miguel de Icaza <miguel@novell.com>
3166 * report.cs (SymbolRelatedToPreviousError): Format the output so
3167 it does not use an open parenthesis that is never closed.
3169 * driver.cs: Follow coding guidelines
3171 2005-09-18 Miguel de Icaza <miguel@novell.com>
3173 * driver.cs: Set InEmacs based on the environment variable EMACS.
3175 * location.cs (InEmacs): in this mode, do not report column
3176 location as it confuses Emacs.
3178 2005-10-03 Raja R Harinath <rharinath@novell.com>
3180 * support.cs (SeekableStreamReader.Position): Don't error out when
3181 the requested position is just beyond the end of the current
3184 2005-09-28 Raja R Harinath <rharinath@novell.com>
3186 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3187 try to keep in sync with the byte count of the underlying Stream.
3188 However, this limits us to a window size of 2048 characters: i.e.,
3189 the maximum lookahead of our lexer/parser can be 2048 characters.
3191 2005-09-22 Martin Baulig <martin@ximian.com>
3193 * driver.cs: Removed a debugging FIXME.
3195 2005-09-21 Raja R Harinath <rharinath@novell.com>
3197 * cs-parser.jay (type_arguments): Add CS1644 check.
3198 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3200 2005-09-15 Raja R Harinath <rharinath@novell.com>
3202 * Makefile (PROGRAM): Make profile specific.
3203 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3204 the current directory.
3207 * expression.cs (Invocation.EmitCall): Remove optimization on
3208 this_call since it doesn't handle 'this' being a value type.
3210 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3212 * driver.cs: Ensure file handles are closed after parsing
3214 2005-09-05 Miguel de Icaza <miguel@novell.com>
3216 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3217 if the underlying types are the same, otherwise we need to produce
3218 code that will do the proper cast.
3220 This was exposed by Marek's constant rewrite which produced
3221 invalid code for the call site:
3224 void Method (X v) {}
3228 This fixes test-49.cs
3230 2005-09-05 Martin Baulig <martin@ximian.com>
3232 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3233 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3235 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3237 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3239 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3240 to be a pointer type due to the spec 25.2, so check if declaring
3241 type is generic type definition. Fixed bug #75772.
3243 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3246 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3247 both types are not defined by methods.
3248 * expression.cs : (Invocation.IsApplicable): it should work when
3249 the argument type is equal to the parameter type, not only when
3250 ImplicitConversionExists() returns true.
3252 2005-09-02 Raja R Harinath <rharinath@novell.com>
3254 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3258 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3259 flow-branching for LocalVariableReferences in case we were invoked
3260 from a MemberAccess.
3261 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3263 (LocalVariableReference.DoResolveBase): ... this.
3264 (MemberAccess.Resolve): Do the check that was disabled during
3267 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3270 (PartialContainer.Create): check abstract/sealed/static strictly
3271 but abstract/sealed can exist only at one side. Fixed bug #75883.
3273 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3276 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3277 specified, don't default to UnmanagedType.I4.
3279 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3281 * expression.cs : conditional operator should check possibly
3282 incorrect assign expression. Fixed bug #75946.
3284 2005-08-30 Raja R Harinath <rharinath@novell.com>
3287 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3288 (ScopeInfo.EmitScopeType): Use it to construct field names from
3289 names of captured locals.
3292 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3293 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3294 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3295 (ExplicitConversion): Remove enum cases already handled by
3296 implicit conversion. Move implicit conversion check to the beginning.
3297 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3298 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3299 Don't treat System.Enum as a struct.
3301 2005-08-30 Jb Evain <jbevain@gmail.com>
3303 * attribute.cs: handles as expression in parameters.
3305 2005-08-30 Raja R Harinath <rharinath@novell.com>
3308 * class.cs (TypeContainer.VerifyClsName): Don't use a
3309 PartialContainer when verifying CLS compliance.
3310 (AbstractPropertyEventMethod): Set Parent here, ...
3311 (PropertyMethod): ... not here.
3313 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3315 * attribute.cs : escaped attribute name should not be allowed to be
3316 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3318 2005-08-29 Raja R Harinath <rharinath@novell.com>
3321 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3322 when converting a long constant to unsigned long.
3323 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3324 detect where IsApplicable and VerifyArgumentsCompat disagree.
3326 2005-08-29 Raja R Harinath <rharinath@novell.com>
3327 and Carlos Alberto Cortez <carlos@unixmexico.org>
3330 * class.cs (TypeContainer.CanElideInitializer): New helper.
3331 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3332 can safely emitting the initializer of a field.
3334 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3336 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3337 allowed inside a switch (without loop). Fixed bug #75433.
3339 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3341 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3342 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3344 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3346 * driver.cs : kinda reverting the default encoding changes (not exact
3347 revert since I noticed that "codepage:reset" might not work fine).
3349 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3351 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3352 Location. Now getter and setter store location correctly.
3353 (errors/cs0111-12.cs now reports the expected location.)
3355 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3357 * driver.cs : Use default encoding on the environment.
3358 Removed (now that) extra parameter for SeekableStreamReader.
3359 * support.cs : (SeekableStreamReader) third .ctor() argument for
3360 StreamReader is not required (always true). preamble size could
3361 be acquired in simpler and safe way.
3363 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3365 * cs-parser.jay: report CS0642 at warning level 3
3366 and report CS0642 for an if else statement also
3367 fixes bug #74745. Patch by John Luke (and a bit
3369 Removed extra CS0642 warning check for "while",
3371 * statement.cs: In Block.Resolve(), CS0642 check
3372 is reimplemented to check a sequence of an empty
3373 statement and a block.
3375 Both fix bug #66777.
3377 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3379 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3380 detection until I fix it.
3382 * cs-tokenizer.cs: Changed error message.
3384 * cs-parser.jay: Fixed 2 error locations.
3386 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3387 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3390 * enum.cs (GetSignatureForError): Fixed.
3392 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3396 * typemanager.cs (RegisterProperty): Removed.
3398 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3400 2005-08-24 Raja R Harinath <rharinath@novell.com>
3403 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3404 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3406 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3408 * expression.cs : tiny fix is required for not warning positive ulong.
3411 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3413 * expression.cs : add CS0652 check for constant and integral
3414 expression. Fixed bug #53974.
3416 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3418 * expression.cs : in DoNumericPromotions(), check if there is implicit
3419 conversion overload for string (to check CS0034). Fixed bug #52492.
3421 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3423 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3425 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3427 * ecore.cs : report location when it is *not* Null.
3429 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3435 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3436 correctly. Fixed bug #75721.
3438 2005-08-23 Raja R Harinath <rharinath@novell.com>
3440 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3441 loop that performs 'min (pos, char_count)'.
3444 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3445 converted value in Operator.OnesComplement.
3447 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3449 * anonymous.cs: If the anon method is pulled into a helper class,
3450 it needs to be `internal' not `private'. Fixes runtime behavior on
3453 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3456 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3459 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3461 The big constants rewrite
3462 Fix #75746, #75685 and more
3463 As a side effect saved 1MB for MWF ;-)
3465 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3466 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3467 enum based for corlib compilation.
3469 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3472 * class.cs (FixedField.Define): Use ResolveAsConstant.
3474 * const.cs (IConstant): Interface constants and enums.
3475 (Const.ResolveValue): New method for constant resolvning.
3476 (ExternalConstant): Constants from imported assemblies.
3478 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3479 conversion; like enums.
3480 (Constant.ToType): Converts this constant to different type.
3481 (Constant.Increment): Adds 1.
3483 * convert.cs (ImplicitConversionRequired): Simplified.
3485 * cs-parser.jay: Create EnumMember directly.
3487 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3489 * doc.cs (GenerateEnumDocComment): Removed.
3491 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3492 (ConvertIntLiteral): Removed.
3493 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3495 * enum.cs (EnumMember): Implement IConstant.
3496 (Enum.IsValidEnumConstant): Removed.
3497 (Enum.GetNextDefaultValue): Removed.
3498 (Enum.FindMembers): Updated.
3499 (Enum.GenerateDocComment): Iterate enum members.
3501 * expression.cs (Cast.TryReduce): Handle enums correctly.
3502 (New.Constantify): Made public.
3503 (MemberAccess.DoResolve): Removed contant specific if(s).
3505 * literal.cs (NullLiteral): Implement new abstract methods.
3507 * statement.cs (GotoCase.Resolve): Use new constant methods.
3508 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3510 * typemanager.cs (LookupEnum): Removed.
3511 (IsEnumType): Fixed to work with corlib.
3512 (RegisterConstant): Removed.
3513 (LookupConstant): Removed.
3514 (GetConstant): Changed to work with IConstant.
3516 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3518 * location.cs : Fixed overflown (>255) column number.
3520 2005-08-03 Raja R Harinath <rharinath@novell.com>
3522 First cut of the qualified-alias-member feature.
3523 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3525 * cs-parser.jay (DOUBLE_COLON): New token.
3526 (namespace_or_type_name): Add rule for recognizing
3527 qualified-alias-members.
3528 (primary_expression): Likewise.
3529 (element_access): Allow QualifiedAliasMember as a possible
3530 type-bearing expression.
3531 (local_variable_type, local_variable_pointer_type): Likewise.
3532 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3533 aliases in the current and enclosing namespace declarations.
3534 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3535 * decl.cs (MemberName.is_double_colon): New.
3536 (MemberName.MemberName): Add new constructor for alias-member.
3537 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3538 * expression.cs (QualifiedAliasMember): New expression type.
3540 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3542 * location.cs : it borked when no argument was specified.
3544 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3546 * location.cs : tiny ToString() format fix.
3548 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3550 * statement.cs : oops, it was missing.
3552 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3554 A set of fixes for precise line/column location.
3557 "token" field now holds a file/line "delta", a line number offset
3558 from the segment, and a column number. See also:
3559 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3560 December/009508.html
3561 Removed static IsNull. Use instance IsNull property instead.
3563 For some tokens it stores Location. For Identifier it stores
3564 LocatedToken which is a pair of string name and location.
3565 Column numbers are adjusted only at getChar().
3567 Use Location.ToString() for reporting (it now contains column).
3569 Largely modified to use LocatedToken instead of
3570 string (IDENTIFIER), and to acquire Location from some tokens.
3571 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3572 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3574 Now MemberName holds Location. DeclSpace.ctor() receives Location
3575 as a parameter. Removed extra parameters to all derived classes.
3576 Replaced Location.IsNull() with instance property.
3577 * assign.cs, expression.cs :
3578 Added .ctor() overload that omits Location.
3580 Added "nameEscaped" flag that indicates the identifier was escaped
3581 in the source file. This fixes bug #57047.
3583 2005-09-02 Martin Baulig <martin@ximian.com>
3585 * class.cs: Make CS3005 a warning, not an error.
3587 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3589 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3590 New method, looking for lo-case imported cls type.
3592 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3595 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3597 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3599 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3601 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3603 Optimized to save 3.5 MB for SWF compilation.
3605 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3607 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3608 (PartialContainer.Create): Moved logic AddToContainer.
3609 (PartialContainer.MarkForDuplicationCheck): Shares name.
3611 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3614 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3616 (Namespace.GetSignatureForError): New method.
3618 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3619 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3621 2005-08-01 Raja R Harinath <rharinath@novell.com>
3624 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3625 member lookup rather than qualifier_type, since qualifier_type can
3628 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3630 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3633 2005-07-31 Miguel de Icaza <miguel@novell.com>
3635 * statement.cs: Copy the local exception into the exception
3636 captured local. Fixes 75674
3638 2005-07-31 Raja R Harinath <harinath@gmail.com>
3641 * expression.cs (Invocation.OverloadResolve): Don't report error
3642 CS1501 if error CS1502 has been reported.
3643 (New.DoResolve): Delegate CS1501 reporting to
3644 Invocation.OverloadResolve.
3647 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3648 invariant-meaning-in-block property in an enclosing block if
3651 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3653 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3654 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3655 (Switch.CheckSwitch): Just save 50kb for SWF.
3657 2005-07-27 Martin Baulig <martin@ximian.com>
3659 * anonymous.cs (CaptureContext.AddField): Added
3660 `AnonymousContainer am' argument; compute its toplevel scope if
3661 it's not already computed. Fixes #75649.
3663 2005-07-26 Raja R Harinath <rharinath@novell.com>
3666 * class.cs (Constructor.Emit): Reset block to null if the block
3669 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3671 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3673 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3675 * class.cs (MethodData.Define): Check whether accessor implementing
3676 interface is public.
3678 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3680 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3683 * namespace.cs (LookupType): Moved same type check to...
3685 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3688 2005-07-21 Raja R Harinath <rharinath@novell.com>
3690 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3691 already found a typebuilder.
3692 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3693 MemberNames, not strings.
3695 * const.cs (Error_ExpressionMustBeConst):
3696 Rename from Error_EpressionMustBeConst.
3697 * const.cs, class.cs, statement.cd: Update.
3699 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3703 * const.cs (Const.LookupConstantValue): Report missing contant expression
3705 (Error_EpressionMustBeConstant): Only one error method.
3707 * class.cs, statement.c: Updated.
3709 2005-07-20 Raja R Harinath <rharinath@novell.com>
3711 * statement.cs (Block.Flags): Add back HasVarargs.
3712 (Block.flags): Make protected.
3713 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3715 * typemanager.cs (types, typecontainers, user_types): Remove.
3716 (UserTypes, TypeContainers): Likewise.
3717 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3718 (CleanUp, Reset): Update.
3719 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3720 (GetNestedType): Use Type.GetNestedType.
3721 (CoreLookupType): Take two arguments, the namespace and the
3722 basename of the type. Update to use the Namespace.Lookup
3724 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3725 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3726 string concatenation and substring matches.
3727 * class.cs, enum.cs, delegate.cs: Update to changes.
3729 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3731 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3732 Expression and made virtual.
3734 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3735 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3737 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3739 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3742 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3745 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3748 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3749 AssemblyCultureAttribute is not used on executable.
3752 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3754 2005-07-16 Raja R Harinath <rharinath@novell.com>
3757 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3758 New. Reports CS0252/CS0253.
3759 Mostly taken from preliminary patch by Duncak Mak.
3760 (Binary.DoResolveOperator): Store results of operator lookup.
3761 Use them to detect if we need to warn about unintended reference
3764 2005-07-15 Raja R Harinath <rharinath@novell.com>
3767 * namespace.cs (Namespace.Lookup): Add back location parameter.
3768 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3769 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3771 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3772 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3773 (Namespace.LookupType): ... this.
3774 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3776 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3777 purported to handle pointers.
3778 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3781 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3783 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3786 2005-07-15 Raja R Harinath <rharinath@novell.com>
3788 * namespace.cs (Namespace.Lookup): Drop location parameter.
3789 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3790 (NamespaceEntry.Lookup): ... this.
3791 (NamespaceEntry.Error_AmbiguousTypeReference):
3792 Move here from DeclSpace.
3793 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3795 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3796 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3797 Move to NamespaceEntry.
3798 * delegate.cs, expression.cs: Update to changes.
3800 2005-08-31 Martin Baulig <martin@ximian.com>
3802 Committing a patch from Atsushi Enomoto for #75850.
3804 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3805 Prefer a generic enumerator over a non-generic one.
3807 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3809 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3810 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3812 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3814 * driver.cs : reverting default encoding change as well as mcs.
3816 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3818 * driver.cs, support.cs : merged r48826.
3820 > could you integrate your mcs changes to gmcs otherwise
3821 > gmcs cannot compile some files.
3823 2005-08-20 Martin Baulig <martin@ximian.com>
3825 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3826 scope if we don't already have it.
3828 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3829 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3832 2005-07-31 Miguel de Icaza <miguel@novell.com>
3834 * statement.cs: Copy the local exception into the exception
3835 captured local. Fixes 75674
3837 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3839 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3842 2005-08-12 Martin Baulig <martin@ximian.com>
3844 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3845 for nested types here to avoid hitting the cache too early.
3847 2005-08-09 Miguel de Icaza <miguel@novell.com>
3849 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3852 2005-08-03 Martin Baulig <martin@ximian.com>
3854 Make iterators in generic methods work; see gtest-191.cs.
3857 (Constraints.Resolve): Protect against being called twice.
3860 (TypeContainer.GetClassBases): Make this `protected virtual'.
3862 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3863 (Iterator.GetClassBases): Override this and compute the base
3865 (Iterator.DefineNestedTypes): If we're a generic method, all our
3866 method type parameters become class type parameters on the proxy
3870 (ToplevelBlock.Parameters): Make this a property, not a field.
3871 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3873 2005-08-03 Martin Baulig <martin@ximian.com>
3875 * typemanager.cs (TypeManager.IsSubclassOf): Use
3876 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3877 (TypeManager.GetFullName_recursed): Improved.
3879 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3882 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3883 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3884 invocation_type == mi.DeclaringType, since the first one also checks
3885 other condition used by generic instances.
3887 2005-07-27 Martin Baulig <martin@ximian.com>
3889 * anonymous.cs (CaptureContext.AddField): Added
3890 `AnonymousContainer am' argument; compute its toplevel scope if
3891 it's not already computed. Fixes #75649.
3893 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3895 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3896 CheckAttributeType and refactored.
3897 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3898 ResolveAsTypeTerminal error handling.
3899 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3901 (GetSignatureForError): Print errors in same way.
3904 * codegen.cs: Reflect attribute GetSignatureForError change.
3907 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3909 * namespace.cs (UsingEntry): Refactored to make fields private.
3912 statement.cs: Error_UnexpectedKind has extra parameter.
3914 2005-07-14 Raja R Harinath <rharinath@novell.com>
3916 * ecore.cs (IAlias): Remove.
3917 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3918 that implement the interface.
3919 * namespace.cs (Namespace): Likewise.
3920 (Namespace.declspaces): Renamed from 'defined_names'.
3921 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3922 DeclSpace instead of an IAlias.
3923 * tree.cs (Tree.AddDecl): Update.
3925 2005-07-12 Raja R Harinath <rharinath@novell.com>
3927 * statement.cs (Block.Flags); Remove HasVarargs.
3928 (Block.HasVarargs): Move to ToplevelBlock.
3929 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3930 (Block.Variables): Make protected. Initialize variable hashtable
3932 (Block.AddVariable): Update.
3933 (Block.Resolve): Update to changes.
3934 (ToplevelBlock.HasVarargs): New boolean.
3935 (ToplevelBlock.ThisVariable): Move here from Block.
3936 (ToplevelBlock.AddThisVariable): Likewise.
3937 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3938 * expression.cs (This.ResolveBase): Update to changes.
3939 (ArglistAccess.DoResolve): Likewise.
3941 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3944 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3946 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3947 not used and not used & assigned.
3948 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3950 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3953 * expression.cs (Is.DoResolve): null is never provided type.
3955 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3958 * cs-parser.jay: Less strict event error rule to catch more errors.
3960 2005-07-11 Martin Baulig <martin@ximian.com>
3962 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3963 for the constructor constraint: we do not only have to check
3964 whether the class has a public constructor, but also ensure that
3965 it's parameterless. Fixes #75492.
3967 2005-07-11 Martin Baulig <martin@ximian.com>
3969 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3970 between type parameters if they either have the reference type
3971 constraint or the class constraint.
3973 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3975 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3977 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3980 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3981 (ExtractSecurityPermissionSet): Cope with self referencing security
3982 attributes properly.
3984 * driver.cs (SetOutputFile): Made public property OutputFile.
3986 2005-07-07 Raja R Harinath <rharinath@novell.com>
3989 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3990 has_nonstatic_fields. Make into a FieldBase pointer.
3991 (TypeContainer.AddField): Add CS0282 check.
3992 (TypeContainer.EmitType): Update.
3994 2005-07-06 Miguel de Icaza <miguel@novell.com>
3996 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3997 compare if they start with __.
3999 2005-07-06 Raja R Harinath <rharinath@novell.com>
4001 * statement.cs (Switch.SwitchGoverningType): Only look at
4002 UserCasts that don't need implicit standard conversions to one of
4003 the allowed switch types (Fixes test-322.cs).
4004 (LocalInfo.Resolve): Re-enable sanity-test.
4006 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4008 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4010 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4012 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4014 2005-07-06 Raja R Harinath <rharinath@novell.com>
4017 * ecore.cs (SimpleName.GetSignatureForError): Add.
4018 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4019 (MemberAccess.GetSignatureForError): Add.
4021 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4023 The big error and warning messages review.
4053 * typemanager.cs: Updated.
4055 * class.cs: (MethodCore.SetYields): Moved here to share.
4056 (PropertyMethod.Define): Moved iterator setup here.
4058 * iterators.cs: Add orig_method to have full access to parent
4061 2005-07-05 Raja R Harinath <rharinath@novell.com>
4063 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4064 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4065 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4066 variable of struct type.
4067 * expression.cs (Unary.ResolveOperator): Update to change.
4068 (Indirection.VerifyFixed): Likewise.
4069 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4070 (ParameterReference.VerifyFixed): Value parameters are fixed.
4071 (This.VerifyFixed): Treat 'this' as a value parameter.
4072 * statement.cs (LocalInfo.IsFixed): Remove.
4074 2005-07-01 Martin Baulig <martin@ximian.com>
4076 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4077 `ec.EmitThis ()' to get the correct scope.
4079 2005-07-01 Martin Baulig <martin@ximian.com>
4081 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4082 instance is a ParameterReference; fixes #75299.
4084 2005-06-30 Raja R Harinath <rharinath@novell.com>
4087 * expression.cs (Indexers.map): Remove.
4088 (Indexers.Append): Filter out inaccessible setters and getters.
4089 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4092 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4094 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4095 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4096 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4097 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4099 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4102 * class.cs (FieldBase.GetInitializerExpression): One more field
4105 2005-06-28 Miguel de Icaza <miguel@novell.com>
4107 * pending.cs: Do not define a proxy if the base method is virtual,
4108 it will be picked up by the runtime (bug 75270).
4110 2005-07-08 Martin Baulig <martin@ximian.com>
4112 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4113 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4115 2005-07-07 Martin Baulig <martin@ximian.com>
4117 * generic.cs (ConstructedType.CheckConstraint): Use
4118 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4119 called recursively; fixes #75329.
4121 2005-07-06 Martin Baulig <martin@ximian.com>
4123 * generic.cs (TypeManager.InferTypeArguments): Added support for
4124 anonymous methods; fixes #75461.
4126 2005-07-01 Martin Baulig <martin@ximian.com>
4128 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4129 `ec.EmitThis ()' to get the correct scope.
4131 2005-07-01 Martin Baulig <martin@ximian.com>
4133 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4134 instance is `This'; fixes #75299.
4136 2005-06-30 Martin Baulig <martin@ximian.com>
4138 * class.cs (Indexer): Implement IIteratorContainer; added support
4139 for iterators in indexers.
4142 (EmitContext.CurrentIterator): Make this a property, not a field.
4144 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4146 2005-06-28 Miguel de Icaza <miguel@novell.com>
4148 * pending.cs: Do not define a proxy if the base method is virtual,
4149 it will be picked up by the runtime (bug 75270).
4151 2005-06-28 Martin Baulig <martin@ximian.com>
4153 * cs-parser.jay (interface_method_declaration): Avoid a
4154 reduce/reduce conflict by moving some of the code into a separate
4155 `interface_method_declaration_body' rule; fixes #75368.
4157 2005-06-28 Martin Baulig <martin@ximian.com>
4159 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4160 array check after the check for TypeBuilder's.
4162 2005-06-21 Raja R Harinath <rharinath@novell.com>
4164 * convert.cs (FindMostEncompassedType): Add two trivial special
4165 cases (number_of_types == 0 || number_of_types == 1).
4166 (FindMostEncompasingType): Likewise.
4168 2005-06-17 Raja R Harinath <rharinath@novell.com>
4170 Some cleanups preparing for the fix of #75283.
4171 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4173 (EventExpr.InstanceResolve): Likewise.
4174 (EventExpr.DoResolve): Remove redundant checks.
4176 2005-06-08 Miguel de Icaza <miguel@novell.com>
4178 * class.cs: Small fix.
4180 2005-06-08 Raja R Harinath <rharinath@novell.com>
4183 * class.cs (GetPartialBases): Fix return value check of
4186 2005-06-07 Raja R Harinath <rharinath@novell.com>
4188 Ensure that partial classes are registered in their enclosing
4189 namespace. Initial part of fix of #75160.
4190 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4191 Register declspace with namespace here, not in
4192 DeclSpace.RecordDecl.
4193 * cs-parser.jay: Pass namespace to RecordDecl.
4194 * class.cs (PartialContainer.Create): Likewise.
4195 (ClassPart.DefineType): New sanity-check. Throws an exception if
4197 * decl.cs (Declspace.RecordDecl): Remove.
4198 * namespace.cs (NamespaceEntry.DefineName): Remove.
4200 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4202 * rootcontext.cs: Reset TargetExt as well.
4204 2005-06-03 Raja R Harinath <rharinath@novell.com>
4206 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4209 2005-06-02 Raja R Harinath <rharinath@novell.com>
4211 Fix #75080, cs0119.cs.
4212 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4214 (Expression.Resolve): ... this. Use it. Remove bogus code
4215 allowing ExprClass.Type and ExprClass.Namespace for
4216 ResolveFlags.VariableOrValue.
4217 (Expression.Resolve) [1-argument variant]: Change default resolve
4218 flags based on language version.
4219 (Expression.Error_UnexpectedKind): Use a simple string array
4220 rather than an ArrayList.
4221 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4223 (TypeOfVoid.DoResolve): Likewise.
4224 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4225 flags argument -- it always has the same value.
4227 2005-05-31 Raja R Harinath <rharinath@novell.com>
4230 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4231 Use it in the error message.
4232 * assign.cs, expression.cs, statement.cs: Update.
4234 2005-05-30 Raja R Harinath <rharinath@novell.com>
4237 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4238 the "almostMatchedMember" case too.
4239 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4240 that failed the accessibility checks to 'almost_match'.
4242 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4244 * attribute.cs: Use internal MethodBuilder methods to set
4245 ExactSpelling and SetLastError on PInvoke methods, instead
4246 of passing them via charset. Fixes #75060.
4248 2005-05-27 Raja R Harinath <rharinath@novell.com>
4250 * parameter.cs (Parameter): Remove TODO comment.
4251 (Parameter.DefineParameter): Remove Location parameter.
4252 (Parameters.LabelParameters): Likewise.
4253 * class.cs (Constructor.Emit): Update to change.
4254 (MethodData.Emit): Likewise.
4255 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4256 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4258 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4261 Removed Parameters.Location and added Parameter.Location instead.
4262 Removed Location parameter from Emit() and GetSignature().
4269 Modified all related calls.
4271 2005-06-21 Martin Baulig <martin@ximian.com>
4273 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4274 left-hand side is not a nullable type; fixes #75328.
4276 2005-06-21 Martin Baulig <martin@ximian.com>
4279 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4280 (TypeManager.GetFullNameSignature): Likewise.
4282 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4283 `source.FullName' and `target.FullName' to check whether there are
4284 two conflicting definitions.
4286 2005-06-21 Martin Baulig <martin@ximian.com>
4288 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4289 a BoxedCast - also for reference types - to be compatible with csc.
4291 2005-06-21 Martin Baulig <martin@ximian.com>
4293 * expression.cs (MemberAccess.DoResolve): Add support for nested
4294 types in a generic instance; fixes #75320.
4296 2005-06-20 Martin Baulig <martin@ximian.com>
4298 * generic.cs (TypeManager.InferType): Also walk the class
4299 hierarchy for generic instances; fixes #75261.
4301 2005-06-17 Martin Baulig <martin@ximian.com>
4303 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4304 to make things work for corlib.
4306 2005-06-15 Martin Baulig <martin@ximian.com>
4308 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4309 obsolete `SecurityAction' values.
4311 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4313 * rootcontext.cs: Reset TargetExt as well.
4315 2005-06-09 Martin Baulig <martin@ximian.com>
4317 * delegate.cs (Delegate.VerifyMethod): Added
4318 `MethodGroupExpr old_mg' argument; inherit its
4319 `HasTypeParameters'; fix #75085.
4321 2005-06-09 Martin Baulig <martin@ximian.com>
4323 * expression.cs (Invocation.OverloadResolve): Correctly handle
4324 generic methods for the SetMemberIsUsed(); fix #75064.
4326 2005-06-09 Martin Baulig <martin@ximian.com>
4328 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4331 2005-06-08 Martin Baulig <martin@ximian.com>
4333 * cs-parser.jay (nullable_type_or_conditional): If we put the
4334 nullable back and our `type' is a `ComposedCast', remove the
4335 nullable from it. Fixes #75156.
4337 * expression.cs (ComposedCast.RemoveNullable): New public method.
4339 2005-06-08 Martin Baulig <martin@ximian.com>
4341 The big Iterators rewrite :-)
4343 * iterators.cs: Rewrite this to use the anonymous methods framework.
4345 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4346 before the TypeContainers; see 2test-21.cs.
4349 (TypeContainer.DefineType): Don't create a new EmitContext if we
4350 already have one (this only happens if we're an Iterator).
4351 (TypeContainer.Define): Also call Define() on all our iterators.
4352 (Method.CreateEmitContext): Added support for iterators.
4355 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4356 (AnonymousContainer.CreateMethodHost): Moved here from
4357 AnonymousMethod and made abstract.
4358 (AnonymousContainer.CreateScopeType): New abstract method.
4359 (AnonymousContainer.IsIterator): New public property.
4360 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4361 get the ScopeTypeBuilder rather than manually defining it here.
4362 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4365 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4366 before RootContext.DefineTypes().
4368 * codegen.cs (EmitContext.RemapToProxy): Removed.
4369 (EmitContext.CurrentAnonymousMethod): Changed type from
4370 AnonymousMethod -> AnonymousContainer.
4371 (EmitContext.ResolveTopBlock): Protect from being called twice.
4372 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4373 (EmitContext.EmitThis): Removed the iterators hacks; use the
4374 anonymous methods framework for that.
4377 (ToplevelBlock.Container): Make this a property, not a field.
4378 (ToplevelBlock.ReParent): New public method; move the
4379 ToplevelBlock into a new container.
4380 (Foreach.TemporaryVariable): Simplify.
4382 2005-06-05 Martin Baulig <martin@ximian.com>
4384 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4385 (Block.AddTemporaryVariable): New public method; creates a new
4386 `LocalInfo' for a temporary variable.
4387 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4389 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4390 non-iterator variables.
4392 2005-06-05 Martin Baulig <martin@ximian.com>
4394 * statement.cs (Foreach.TemporaryVariable): Create the
4395 LocalBuilder in the Emit phase and not in Resolve since in some
4396 situations, we don't have an ILGenerator during Resolve; see
4397 2test-19.cs for an example.
4399 2005-06-04 Martin Baulig <martin@ximian.com>
4401 The big Foreach rewrite - Part II.
4403 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4404 with `PropertyInfo ienumerator_getcurrent'.
4406 * codegen.cs (VariableStorage): Removed.
4409 (Foreach): Derive from Statement, not ExceptionStatement.
4410 (Foreach.CollectionForeach): New nested class. Moved all the code
4411 dealing with collection foreach here.
4412 (Foreach.ForeachHelperMethods): Removed.
4413 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4415 2005-05-23 Martin Baulig <martin@ximian.com>
4417 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4418 don't need to. Fix #75014.
4420 2005-05-26 Raja R Harinath <rharinath@novell.com>
4422 Improve user-defined conversion handling.
4423 * convert.cs (GetConversionOperators): Rewrite. Return only the
4424 applicable operators.
4425 (AddConversionOperators): New. Helper for GetConversionOperators.
4426 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4427 there is only one most encompassed/encompassing type.
4428 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4429 "applicable operator" handling.
4430 (UserConversion): Move cache here from GetConversionOperators.
4431 Directly cache the chosen operator, rather than the whole
4433 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4434 case. Allow conversion of decimal to sbyte and byte too.
4435 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4436 New static methods. Used to avoid allocating EmptyExpressions in
4439 2005-05-24 Duncan Mak <duncan@novell.com>
4441 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4442 another class, used in Convert.ExplicitNumericConversion.
4443 (CastToDecimal): New class, similar to above, but casts to
4444 System.Decimal, used in Convert.ImplicitNumericConversion and also
4445 in explicit convesion from double/float to decimal.
4447 * convert.cs (ImplicitNumericConversion): Handle implicit
4448 conversions to System.Decimal.
4449 (ExplicitNumericConversion): handle explicit conversions to
4454 2005-05-20 Miguel de Icaza <miguel@novell.com>
4456 * typemanager.cs: Do not throw an exception in the TypeBuilder
4457 case, we take care of it on the TypeCode.
4459 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4461 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4464 * cs-parser.jay: Catch more lexical errors.
4466 * report.cs: Add one more Error method.
4469 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4471 2005-05-20 Martin Baulig <martin@ximian.com>
4473 * class.cs (TypeContainer.CircularDepException): Removed.
4474 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4475 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4476 (CS0146) and interface (CS0529) dependencies here.
4478 2005-05-20 Martin Baulig <martin@ximian.com>
4480 * expression.cs (New.DoResolve): Move the CS0712 check above the
4481 CS0144 check; otherwise it can never be reached.
4483 2005-05-20 Martin Baulig <martin@ximian.com>
4485 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4487 2005-05-20 Martin Baulig <martin@ximian.com>
4489 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4491 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4493 2005-05-19 Martin Baulig <martin@ximian.com>
4496 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4497 to disable error reporting.
4499 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4500 here since we don't want to report an error; see the new test-336.cs.
4502 2005-05-19 Raja R Harinath <rharinath@novell.com>
4504 * statement.cs (ToplevelBlock.GetParameterReference)
4505 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4506 Move here from class Block.
4507 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4508 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4510 2005-05-18 Martin Baulig <martin@ximian.com>
4515 (FlowBranching.Reachability): Add non-static public And() and Or()
4517 (FlowBranchingSwitch): New class; do the `break_origins' thing
4518 like in FlowBranchingLoop.
4519 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4520 reachability, not just locals and parameters.
4521 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4522 switch; MergeBreakOrigins() now takes care of that.
4524 2005-05-18 Martin Baulig <martin@ximian.com>
4526 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4527 a loop and may leave it, reset the barrier; fixes #74974.
4529 2005-05-16 Raja R Harinath <rharinath@novell.com>
4531 Fix test-382.cs. Emit values of decimal constants.
4532 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4534 (TypeContainer.AddField): ... this.
4535 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4536 with initializers to include 'Const's.
4537 (ClassPart.RegisterFieldForInitialization): Forward to
4539 * const.cs (Const.Const): Pass initializer to base class.
4540 (Const.Define): In case of decimal constants, register them for
4541 initialization in a static constructor.
4543 2005-05-14 Martin Baulig <martin@ximian.com>
4545 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4546 do not call ResolveUnreachable() on unreachable statements in
4547 here, see the comment in the source code.
4549 2005-05-13 Raja R Harinath <rharinath@novell.com>
4552 * expression.cs (BinaryResolveOperator): If one of the operands of
4553 an equality comparison is 'null' and the other is a pointer type,
4554 convert the null to a NullPointer.
4555 * convert.cs (ImplicitReferenceConversion): If the expression is a
4556 NullLiteral and the target type is a pointer type, return a
4557 NullPointer instead.
4558 (ImplicitConversionStandard): Likewise.
4560 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4562 * cs-parser.jay: Set readonly context based on special constructs.
4564 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4565 readonly variable error handling.
4567 * rootcontext.cs (EmitCode): Don't verify members when error
4570 * statement.cs (LocalInfo): Add reaodnly context information.
4571 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4573 2005-05-17 Martin Baulig <martin@ximian.com>
4575 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4578 2005-05-13 Martin Baulig <martin@ximian.com>
4580 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4581 handle unreachable blocks.
4583 2005-05-13 Martin Baulig <martin@ximian.com>
4586 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4587 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4590 2005-05-13 Martin Baulig <martin@ximian.com>
4592 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4593 instance variable, not a local. Fix #74873.
4594 (Block.ResolveUnreachable): Set it to true here.
4596 2005-05-12 Martin Baulig <martin@ximian.com>
4598 * cs-parser.jay (property_declaration): Pass the `current_class',
4599 not the `current_container' to Property's .ctor. Fixes #74912.
4601 2005-05-11 Martin Baulig <martin@ximian.com>
4603 * typemanager.cs (Closure): Copy this from MCS and merge all the
4604 GMCS-specific changes into it.
4606 2005-05-12 Raja R Harinath <harinath@gmail.com>
4609 * typemanager.cs (unmanaged_enclosing_types): New.
4610 (IsUnmanagedType): Avoid infloops by using
4611 'unmanaged_enclosing_types' to talk with recursive invocations.
4613 2005-05-11 Duncan Mak <duncan@novell.com>
4615 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4616 continuing to process for 'arg'.
4617 (handle_preprocessing_directive): Check the argument of the #endif
4618 directive and report error CS1025 if there are any trailing
4621 According to the C# spec, having even whitespace after the #endif
4622 directive is illegal; however, because we call arg.TrimEnd ()
4623 beforehand, we have the same behavior as csc, allowing whitespace
4624 after the directive.
4628 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4632 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4633 (Constructor.GetObsoleteAttribute): Implemented correctly.
4635 2005-05-10 Martin Baulig <martin@ximian.com>
4637 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4638 resolve the type; fixes #74864.
4639 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4640 in DoResolve(); fixes #74862.
4642 2005-05-10 Martin Baulig <martin@ximian.com>
4644 * support.cs (ReflectionParameters.ParameterModifier): Use
4645 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4646 and `ParameterAttributes.In'. Fixes #74884.
4648 2005-05-10 Martin Baulig <martin@ximian.com>
4650 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4651 the cache if we're just looking for `MemberTypes.NestedType' in a
4654 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4655 constraints if we're still resolving the type tree.
4656 (Expression.MemberLookup): If we're resolving the type tree, only
4657 look for `MemberTypes.NestedType' since we're only interested in
4660 * class.cs (TypeContainer.DefineType): Don't resolve the type
4661 parameters here; do this later in ResolveType() after the type
4662 tree has been resolved.
4663 (TypeContainer.ResolveType): New public method; this is called
4664 after the type tree is resolved and before the types are being
4665 populated. We resolve the generic constraints here.
4666 (TypeContainer.DoDefineMember): Check the constraints on our base
4667 class and interfaces.
4669 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4670 set the `ResolvingTypeTree' flag on the EmitContext.
4672 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4674 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4676 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4678 * expression.cs (Argument.GetParameterModifier): Turned to property.
4679 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4681 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4684 2005-05-09 Raja R Harinath <rharinath@novell.com>
4687 * decl.cs (MemberCache.AddMethods): Register override methods,
4688 rather than non-override methods.
4689 * typemanager.cs (RegisterOverride): New.
4690 (IsOverride): Update.
4692 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4694 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4696 2005-05-06 Martin Baulig <martin@ximian.com>
4699 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4700 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4702 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4706 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4707 recursive declaration.
4709 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4711 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4713 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4715 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4717 2005-05-05 Raja R Harinath <rharinath@novell.com>
4720 * decl.cs (DeclSpace.FamilyAccessible):
4721 Use TypeManager.IsNestedFamilyAccessible.
4723 Fix reopened #64812.
4724 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4727 2005-05-04 Raja R Harinath <rharinath@novell.com>
4728 Abin Thomas <projectmonokochi@rediffmail.com>
4729 Anoob V E <projectmonokochi@rediffmail.com>
4730 Harilal P R <projectmonokochi@rediffmail.com>
4733 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4734 allow access to all static members.
4736 2005-05-04 Martin Baulig <martin@ximian.com>
4738 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4740 2005-05-04 Martin Baulig <martin@ximian.com>
4744 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4745 section at the end; make things work if `default' is not the last
4748 2005-05-04 Martin Baulig <martin@ximian.com>
4752 * statement.cs (Switch): Replaced the `got_default' field with a
4753 `default_section' one.
4754 (Switch.CheckSwitch): Set `default_section' here.
4755 (Switch.Resolve): If we're a constant switch and the constant is
4756 not found, use the default section.
4758 2005-05-03 Martin Baulig <martin@ximian.com>
4760 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4762 * statement.cs (Foreach.ArrayForeach): New nested class.
4763 (Foreach.TemporaryVariable): New nested class.
4764 (Foreach.EmitArrayForeach): Removed; this is now in the new
4767 2005-05-03 Raja R Harinath <rharinath@novell.com>
4769 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4771 (VerifyPendingMethods): Revert change below.
4773 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4774 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4775 that used to trigger warning -28. Remove warning -28.
4776 * expression.cs (Invocation.OverloadResolve): Use
4777 TypeManager.IsOverride to distinguish override methods.
4780 * pending.cs (VerifyPendingMethods): If a base type implements the
4781 requested interface, don't bother checking individual methods of
4782 the base type. As a side-effect, this prevents the creation of
4783 unnecessary proxies.
4785 2005-05-02 Martin Baulig <martin@ximian.com>
4789 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4790 Also `And' the locals if the old vector is null.
4791 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4792 null; in this case we basically reset all the variables.
4794 2005-05-02 Martin Baulig <martin@ximian.com>
4798 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4799 Added `FlowBranching branching' argument; always `and' the
4800 variables instead of `or'ing them unless we're an infinite loop.
4802 * statement.cs (While.Resolve): Create a new sibling unless we're
4805 2005-05-02 Martin Baulig <martin@ximian.com>
4809 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4810 arguments; use it instead of creating a new TopLevelBlock.
4811 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4812 our ConstructorInitializer.
4815 (TopLevelBlock.TopLevelBranching): New public property.
4816 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4817 and create our `TopLevelBranching'.
4819 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4820 anonymous method host, use `block.TopLevelBranching' rather than
4821 creating a new branching.
4823 2005-04-20 Miguel de Icaza <miguel@novell.com>
4825 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4826 a ScopeInfo, if any of the current children is a child of the new
4827 entry, move those children there.
4829 2005-04-30 Martin Baulig <martin@ximian.com>
4831 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4832 at the beginning of a SwitchSection. Fix #73335.
4834 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4837 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4839 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4840 (FieldExpr.DoResolve): Obsolete members are ignored for field
4843 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4845 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4846 of arrays detection.
4848 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4850 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4852 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4855 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4857 * cs-parser.jay: Use the prefered version of -unsafe in error
4860 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4862 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4865 2005-04-20 John Luke <john.luke@gmail.com>
4867 * driver.cs: fix typo in error message, --outout to --output
4869 2005-04-30 Martin Baulig <martin@ximian.com>
4871 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4872 handle the .NET 2.x security attributes.
4874 2005-04-30 Martin Baulig <martin@ximian.com>
4877 (TypeManager.ExpandInterfaces): Don't add things twice.
4880 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4882 2005-04-29 Martin Baulig <martin@ximian.com>
4884 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4886 * anonymous.cs: Added support for anonymous generic methods.
4888 2005-04-29 Martin Baulig <martin@ximian.com>
4890 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4893 2005-04-29 Martin Baulig <martin@ximian.com>
4895 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4897 * expression.cs (New.DoResolve): Fix the CS0304 check.
4899 2005-04-29 Martin Baulig <martin@ximian.com>
4901 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4904 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4905 explicit interface implementation, compare the interface types.
4906 (MethodData.Define): Use the new naming scheme from the latest
4908 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4910 * decl.cs (MemberName.GetMemberName): Removed.
4911 (MemberName.MethodName, FullName): New properties.
4913 2005-04-25 Raja R Harinath <rharinath@novell.com>
4915 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4917 2005-04-22 Martin Baulig <martin@ximian.com>
4919 * generic.cs (GenericMethod): Create the EmitContext in the
4920 `Define()'; in `Define(MethodBuilder)', create the type parameters
4921 before calling `Define()'. Fixes #73933.
4923 2005-04-22 Martin Baulig <martin@ximian.com>
4926 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4927 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4929 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4930 ConstructedType, check its constraints.
4932 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4934 * codegen.cs (InRefOutArgumentResolving): New field.
4936 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4937 fields outside contructor.
4939 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4941 2005-04-19 Miguel de Icaza <miguel@novell.com>
4943 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4944 parameter code was not completed ever, so it was not as up-to-date
4945 as local variables. Must finish it.
4947 The bug fix was to compare the Toplevel of the block, not the
4948 current block. Thanks for Ben for pointing this out.
4950 2005-04-19 Raja R Harinath <rharinath@novell.com>
4952 * decl.cs (AddMethods): Use the declaring type of the problem
4953 method to determine if we want to squash a warning.
4955 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4957 * attribute.cs: Removed debug output.
4959 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4961 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4964 2005-04-18 Raja R Harinath <rharinath@novell.com>
4967 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4968 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4969 all null comparisons against reference types.
4971 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4974 * class.cs (TypeContainer.CircularDepException) New nested
4976 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4977 (TypeContainer.DefineType): Removed error, reset InTransit before
4979 (Class.DefineType): Throw exception when is in Transit.
4980 Catch exception and report error.
4981 (Struct.DefineType): Throw exception when is in Transit.
4982 Catch exception and report error.
4983 (Interface.DefineType): Throw exception when is in Transit.
4984 Catch exception and report error.
4986 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4987 handle nested exception handlers.
4989 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4992 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4993 InFinally and InCatch storage.
4995 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4996 (Catch.Resolve): Set and Restore ec.InCatch.
4997 (Try.Resolve): Set and Restore ec.InFinally.
4998 (Try.HasCatch): True when try has catch.
5000 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5002 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5003 for the same event member, so exclude such cases from warning 419.
5006 2005-04-16 Miguel de Icaza <miguel@novell.com>
5008 * expression.cs (Binary.ResolveOperator): Apply patch from John
5009 Luke to fix bug 59864: operators &, | and ^ on enumerations
5010 require that the same enum type on both sides.
5012 * driver.cs: Add warnings to old flag usage, this is to assist
5013 people who produce Makefiles and hope that the Makefiles will be
5016 * class.cs (TypeContainer.EmitType): Moved the definition of the
5017 special $PRIVATE$ field from the resolve phase to the Emit phase.
5018 During resolve we do not know if we are a struct with
5019 HasExplicitLayout, we know this only after the attributes for the
5022 Set the FieldOffset to zero on the dummy field that we create for
5023 the class. Fixes 74590.
5025 2005-04-16 Raja R Harinath <rharinath@novell.com>
5028 * ecore.cs (PropertyExpr.resolved): New.
5029 (DoResolve): Use it to handle a case of double resolution here.
5030 Handle a case of identical-name-and-type-name.
5031 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5032 resolution by storing the results of expression resolution back
5033 into the "probes" array.
5035 2005-04-15 Raja R Harinath <rharinath@novell.com>
5037 Fix cs0208-7.cs and cs0208-8.cs.
5038 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5039 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5040 error reporting to point out the reason a struct is not unmanaged.
5042 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5044 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5045 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5047 2005-04-13 Raja R Harinath <rharinath@novell.com>
5050 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5051 IdenticalNameAndTypeName here.
5052 (EventExpr.InstanceResolve): Likewise.
5054 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5056 C# 2.0 DefaultCharSetAttribute implementation
5058 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5059 which allows us to set GlobalNamespace for every resolve.
5060 (Attribute.ResolveArguments): Cut from Resolve.
5061 (Attribute.GetCharSetValue): Returns CharSet named argument.
5062 (Attribute.DefinePInvokeMethod): Gets default charset from
5064 (GlobalAttribute.ResolveAsTypeStep): Override.
5065 (GlobalAttribute.ResolveArguments): Override.
5067 * class.cs (TypeAttr): Is protected.
5069 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5070 (ModuleClass.DefaultCharSetType): New memeber.
5071 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5073 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5074 charset from module.
5076 * delegate.cs (TypeAttr): Override.
5077 (Delegate.DefineType): Use this TypeAttr.
5079 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5080 at very early stage (before types are defined) to resolve model
5081 module attributes. It will probably not work with corlib but it
5084 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5085 charset from module.
5087 * typemanager.cs (default_charset_type): New type.
5089 2005-04-13 Raja R Harinath <rharinath@novell.com>
5091 * decl.cs (MemberCache.AddMethods): Don't warn if
5092 System.Object.Finalize has buggy MethodAttributes.
5094 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5097 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5099 * doc.cs : detect ambiguous reference to overloaded members.
5100 Fixed bug #71603. MS 1.1 csc does not detect it.
5102 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5104 * doc.cs : delegates must not be referenced with parameters.
5107 2005-04-12 Miguel de Icaza <miguel@novell.com>
5109 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5111 2005-04-10 Miguel de Icaza <miguel@novell.com>
5113 * driver.cs (MainDriver): Stop processing if the CLS stage found
5116 (CompilerCallableEntryPoint.InvokeCompiler): Always
5117 reset after execution; Take a TextWriter argument for the
5120 * report.cs: Use the error stream instead of hardcoding stderr.
5122 2005-04-09 Miguel de Icaza <miguel@novell.com>
5124 * class.cs: Reduce code paths to test, too small of an
5125 optimization to make it worth the extra testing. Always perform
5128 2005-04-08 Raja R Harinath <rharinath@novell.com>
5131 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5132 operators that had errors reported on them.
5134 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5136 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5138 (Attribute.Resolve): Add named argument type checking.
5140 * class.cs (FixedField.Define): Use IsPrimitiveType
5142 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5144 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5145 unsafe parameter types.
5147 * statement.cs (Using.ResolveExpression): Add better error description.
5149 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5151 2005-04-08 Raja R Harinath <rharinath@novell.com>
5154 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5155 AttributeUsageAttribute in the emitcontext of the attribute class,
5156 not in the emitcontext of the attributable entity it was attached to.
5157 * cs-parser.jay: Use 'current_class', not 'current_container',
5158 when creating a GlobalAttribute.
5160 2005-04-08 Alp Toker <alp@atoker.com>
5162 * pending.cs: The fix to #58413 failed to compile methods implementing
5163 interfaces with/without params modifiers and vice versa, even though
5164 params modifiers aren't part of the signature. Make the modifier check
5165 less strict as in csc.
5167 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5168 Anoob V E <projectmonokochi@rediffmail.com>
5169 Harilal P R <projectmonokochi@rediffmail.com>
5172 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5173 modifiers of pending methods.
5174 (PendingImplementation.PendingImplementation): Initialize it.
5175 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5176 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5177 with ParameterData. Add check for modifiers.
5178 * class.cs (MethodData.Define): Update to changes.
5180 2005-04-07 Raja R Harinath <rharinath@novell.com>
5182 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5184 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5186 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5189 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5192 * typemanager.cs: Registered RequiredAttributeAttribute.
5194 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5196 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5197 Warning CS0169 is back at level 3.
5198 (IMethodData.SetMemberIsUsed): New method.
5200 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5201 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5203 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5205 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5207 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5210 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5213 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5214 to avoid the problems with nested types.
5216 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5217 Anoob V.E <projectmonokochi@rediffmail.com>
5218 Harilal P.R <projectmonokochi@rediffmail.com>
5219 Raja R Harinath <rharinath@novell.com>
5222 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5224 * typemanager (GetConstructor): Make public.
5226 2005-04-05 John Luke <john.luke@gmail.com>
5227 Raja R Harinath <rharinath@novell.com>
5230 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5231 struct too. Return false quicker in a few cases.
5232 (VerifyUnManaged): Use it.
5234 2005-04-05 Raja R Harinath <rharinath@novell.com>
5237 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5238 not 'unreachable_seen'.
5240 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5242 * attribute.cs (Attribute.GetValue): Removed unused.
5244 * codegen.cs (CodeGen.TrimExt): Removed unused.
5246 * cs-parser.jay (output): Removed unused.
5248 * cs-tokenizer.cs (hex_digits): Removed unused.
5250 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5252 * expression.cs (Indirection.LoadExprValue): Removed unused.
5253 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5255 * iterators.cs (Iterator.param_types): Removed unused.
5257 * statement.cs (Goto.block): Removed unused.
5258 (ToplevelBlock.did): Removed unused.
5259 (Switch.ResolveConstantSwitch): Removed unused.
5261 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5263 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5266 2005-04-19 Martin Baulig <martin@ximian.com>
5268 Merged r42462 from MCS and made it work for GMCS.
5270 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5272 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5274 2005-04-01 Raja R Harinath <rharinath@novell.com>
5276 Fix #74232 and cs0208-3.cs.
5277 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5278 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5279 unmanaged type. Don't use FieldBuilders when 't' is a
5280 TypeBuilder. Use ModFlags and MemberType fields.
5281 * class.cs (MemberBase.member_type): Rename from MemberType.
5282 (MemberBase.MemberType): New property. Determines member_type on
5284 (MemberBase.DoDefine): Don't initialize MemberType here.
5285 (FieldMember.Define): Likewise.
5287 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5290 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5291 Attributes are emitted there.
5293 2005-04-01 Raja R Harinath <rharinath@novell.com>
5295 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5296 keyword in 'partial enum' too.
5297 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5299 Report from Kamil Skalski <nazgul@omega.pl>.
5302 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5303 have partial containers too.
5305 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5306 in block' checks to Block.CheckInvariantMeaningInBlock.
5307 * statement.cs (Block.GetKnownVariableInfo): Make private.
5308 (Block.IsVariableUsedInChildBlock): Remove.
5309 (Block.IsVariableUsedInBlock): Likewise.
5310 (Block.CheckInvariantMeaningInBlock): New. Show location of
5311 conflicting declaration.
5312 (Block.AddVariable): Make error messages less long-winded and more
5313 specific. Show location of conflicting declaration.
5314 * parameter.cs (Parameters.Location): New readonly property.
5316 2005-03-31 Raja R Harinath <rharinath@novell.com>
5318 Clean up semantics of invoking ResolveMemberAccess.
5319 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5320 can have an instance, ensure that we pass in a non-TypeExpression
5321 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5322 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5323 argument. Update to changes and simplify.
5324 (FieldExpr.Emitinstance): Remove CS0120 check.
5325 (PropertyExpr.EmitInstance): Likewise.
5326 * expression.cs (Argument.Resolve): Likewise.
5327 (Invocation.DoResolve): Update to changes in semantics of
5330 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5333 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5336 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5338 2005-03-31 Raja R Harinath <rharinath@novell.com>
5340 Fix difference in behaviour with commandline invocation.
5341 * driver.cs (Driver.Reset): New.
5342 (CompilerCallableEntryPoint): Call it.
5344 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5345 variable" warnings if the boolean expression failed to resolve.
5347 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5349 * attribute.cs: Fix the union of several permissions when some of them
5350 are unrestricted (so the result isn't an unrestricted permission set).
5353 2005-03-30 Raja R Harinath <rharinath@novell.com>
5355 * ecore.cs (MemberExpr): New class. Convert from interface
5357 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5358 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5360 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5361 (MethodGroupExpr.IsExplicitImpl): Remove.
5362 (Expression.GetFieldFromEvent): Remove.
5363 (SimpleName.MemberStaticCheck): Remove.
5364 (SimpleName.DoSimpleNameResolve): Update to changes.
5365 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5366 (MemberAccess.IdenticalNameAndTypeName): Remove.
5367 (MemberAccess.error176): Move to MemberExpr.
5368 (MemberAccess.DoResolve): Update to changes.
5369 (BaseAccess.DoResolve): Likewise.
5371 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5373 C# 2.0 Conditional attribute class implementation
5375 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5376 Analyzes class whether it has attribute which has ConditionalAttribute
5377 and its condition is not defined.
5379 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5380 (Class.IsExcluded): New method. Search for at least one defined
5381 condition in ConditionalAttribute of attribute class.
5383 2005-03-30 Raja R Harinath <rharinath@novell.com>
5385 * ecore.cs (PropertyExpr): Derive from Expression, not
5386 ExpressionStatement.
5387 (PropertyExpr.EmitStatement): Remove.
5389 2005-03-29 Raja R Harinath <rharinath@novell.com>
5392 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5393 internal field "value__" of an enum be private. The examples for
5394 "value__" that I found on MSDN all used FieldAttributes.Private.
5396 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5397 Don't mention IL method attribute names.
5399 Fix #47991. Remove a TODO.
5400 * statement.cs (Block.Toplevel): Make into a field.
5401 (Block.Parameters): Move into ToplevelBlock.
5402 (Block.known_variables): Rename from child_variable_names.
5403 (Block.Block): Remove variants that take Parameters. Initialize
5404 'Toplevel' with the immediately surrounding toplevel block.
5405 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5406 LocalInfo parameter.
5407 (Block.GetKnownVariableInfo): New.
5408 (Block.IsVariableNameUsedInChildBlock): Update.
5409 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5410 the block, even though it may not be in scope.
5411 (Block.AddVariable): Remove Parameters parameter. Use
5412 Toplevel.Parameters instead.
5413 (Block.AddConstant): Remove Parameters parameter.
5414 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5415 (Block.IsParamaterReference): Likewise.
5416 (Block.IsLocalParameter): Likewise. Simplify a lot.
5417 (ToplevelBlock.Parameters): New. Moved from Block.
5418 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5419 initialize Parameters to a non-null value.
5420 * cs-parser.jay: Update to changes.
5421 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5422 simple names that mean different things in the same block. Use
5423 Block.IsVariableNameUsedInBlock.
5425 2005-03-28 Raja R Harinath <rharinath@novell.com>
5427 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5429 2005-03-26 Raja R Harinath <harinath@acm.org>
5432 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5433 fails to resolve, ensure that the LHS is still resolved as an
5436 2005-03-25 Raja R Harinath <harinath@acm.org>
5438 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5440 (Enum.current_ec): Remove.
5441 (Enum.LookupEnumValue): Remove EmitContext argument.
5442 Just uses the one created during DefineType.
5443 (Enum.FindMembers): Update.
5444 * expression.cs (MemberAccess.DoResolve): Update.
5446 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5448 * assign.cs (Assign.DoResolve): Check for CS1717 when
5449 source and target are same (uses Equals).
5451 * expression.cs (LocalVariableReference, ParameterReference,
5452 This): Implemented Equals, GetHashCode.
5454 * statement.cs (Block.GetParameterReference): Removed useless
5457 2005-03-22 Raja R Harinath <rharinath@novell.com>
5460 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5461 blocks before deciding whether the error is cs0136 or cs0128.
5463 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5464 (using_alias_directive, using_namespace_directive): Pass
5465 MemberName, not an expression to Namespace.UsingAlias and
5467 (MakeName): Use the MemberName of the namespace.
5468 * namespace.cs (Namespace.MemberName): New.
5469 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5470 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5472 * decl.cs (MemberName.Name): Make readonly.
5473 (MemberName.FromDotted): New "constructor".
5474 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5475 (MemberCore.Name): Compute from MemberName on demand.
5476 (MemberCore.SetMemberName): Provide a way to change the
5478 (MemberCore.AddToContainer): Don't take a fullname parameter.
5479 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5480 fully qualified name of the container to the member name.
5481 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5482 only if the type is a member of the root container.
5483 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5484 MemberName.Left rather than searching for an embedded ".".
5485 (PartialContainer.CreatePart): Update to changes in RootContext.
5486 (MemberBase.ShortName): Turn into a property. Use
5487 MemberCore.SetMemberName.
5488 (MemberBase.ExplicitInterfaceName): Remove.
5489 (MemberBase.UpdateMemberName): Remove.
5490 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5491 (PropertyBase.SetMemberName): New override.
5492 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5493 (Tree.GetDecl): New.
5494 (Tree.AllDecls): Rename from Decls.
5495 * attribute.cs, enum.cs, report.cs: Update to changes.
5496 * driver.cs (MainDriver): Use MemberName.FromDotted on
5497 RootContext.MainClass.
5499 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5501 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5504 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5506 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5508 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5509 property accessor modifiers.
5511 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5512 fixed buffer attribute (CS1716).
5513 (PropertyMethod.HasCustomAccessModifier): When property accessor
5514 has custom modifier.
5516 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5518 (PropertyExpr.DoResolveLValue): Add CS0272.
5520 2005-03-17 Miguel de Icaza <miguel@novell.com>
5522 * convert.cs: When converting to a pointer, use the proper Conv.U
5523 or Conv.I depending on the source data type.
5525 * cs-tokenizer.cs: Make the size for large decimal constants,
5528 2005-03-17 Martin Baulig <martin@ximian.com>
5530 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5531 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5533 2005-03-17 Martin Baulig <martin@ximian.com>
5535 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5536 to bool so we can return an error condition.
5537 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5540 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5542 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5545 2005-03-16 Raja R Harinath <rharinath@novell.com>
5547 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5548 Refactor to avoid traversing the list of assemblies, and to avoid
5549 string concatenation.
5550 * typemanager.cs (guid_attr_type): Remove.
5551 (negative_hits, pointers, references): Remove hashes.
5553 (GetConstructedType): New. Uses type_hash to handle constructed
5554 types (arrays, references, pointers).
5555 (GetReferenceType, GetPointerType): Use it.
5556 (GetNestedType): New. Uses type_hash to handle nested types of
5558 (LookupType, LookupTypeDirect): Remove.
5559 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5560 'types' hash and LookupTypeReflection directly.
5561 (params_string, params_object): Use GetConstructedType.
5562 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5564 (Namespace.Lookup): Use cached_types.
5565 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5566 provided by old TypeManager.LookupType.
5567 * rootcontext.cs (MakeFQN): Remove.
5568 * decl.cs (DeclSpace.MakeFQN): Likewise.
5569 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5570 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5571 TypeManager.GetConstructedType.
5572 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5574 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5576 * cs-parser.jay: Fix build.
5578 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5580 * class.cs (TypeContainer.CircularDepException) New nested
5581 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5583 * cs-parser.jay: Reports CS1527 for any namespace element.
5585 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5588 * expression.cs (ParameterReference.IsAssigned): Changed error to
5590 (Error_WrongNumArguments): Moved CS0245 detection here.
5592 * statement.cs (Return.Resolve): Add CS1622 report.
5594 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5596 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5598 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5600 * attribute.cs expression.cs: Get rid of some allocations.
5602 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5604 * doc.cs : just eliminate the latest change.
5606 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5608 * doc.cs : commented out the latest change. It breaks xml-030.cs
5610 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5612 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5613 fail. So invoke CreateType() in FindDocumentedType().
5615 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5617 * cs-tokenizer.cs : added IsKeyword().
5618 * doc.cs : Detect keyword incorrectly used as identifier.
5619 Allow identifiers prefixed by @.
5621 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5623 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5624 It caused exception in namespace resolving (again!).
5626 * class.cs (Class.ctor): Removed exit.
5627 (PropertyMethod.ctor): ditto.
5629 * codegen.cs (Codegen.Reset): Reset static data.
5630 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5632 * cs-tokenizer.cs (Cleanup): Removed.
5634 * driver.cs (GetSystemDir): Rewrote to one line command.
5635 It caused problem with unloaded dynamic modules.
5636 (UnixParseOption): Removed Exit.
5637 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5638 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5639 Now can be mcs used as library.
5641 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5644 * location.cs (Reset): Reset static data.
5646 * namespace.cs (Reset): Reset static data.
5648 * report.cs (Report.Reset): Reset static data.
5650 * rootcontext.cs (RootContext.Reset): Reset static data.
5652 * tree.cs (RootTypes.ctor): Use Location.Null
5654 * typemanager.cs (TypeManager.Reset): Reset static data.
5655 (CoreLookupType): Removed Exit.
5656 (TypeHandle.Reset): Reset static data.
5658 2005-03-10 Raja R Harinath <rharinath@novell.com>
5661 * typemanager.cs (ComputeNamespaces): Import namespaces from
5662 referenced modules too.
5664 2005-03-09 Raja R Harinath <rharinath@novell.com>
5666 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5669 2005-03-09 Raja R Harinath <rharinath@novell.com>
5671 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5672 enclosing DeclSpace. This ensures that a name-lookup populates
5673 more caches and there are fewer 'TypeExpression's. Carve out
5674 nested type lookup into ...
5675 (LookupNestedTypeInHierarchy): ... this.
5677 2005-04-15 Martin Baulig <martin@ximian.com>
5679 Merged r41590 from MCS and make it work in the generics land.
5681 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5684 * class.cs (PartialContainer.UpdateConstraints): Removed.
5685 (PartialContainer.CheckConstraints): Removed.
5686 (PartialContainer.SetParameterInfo): Store the constraints here.
5687 (PartialContainer.DefineTypeParameters): New public method;
5688 resolve the type parameter's constraints here. Note that the
5689 PartialContainer doesn't have an EmitContext anymore, so we must
5690 do this in the ClassPart.
5692 2005-03-09 Raja R Harinath <rharinath@novell.com>
5694 Clean up a few partial-class semantics.
5695 Fixes test-357.cs and cs1618-2.cs.
5696 * cs-parser.jay (struct_declaration): Use 'current_class' as
5697 parent of newly-created struct. Remove call to Register ().
5698 Use 'pop_current_class' to complete handing the current struct.
5699 (interface_declaration): Likewise.
5700 (class_declaration): Likewise.
5701 (enum_declaration): Use 'current_class' as parent of newly created
5703 (delegate_declaration): Likewise.
5704 (pop_current_class): New function. This is used to handle closing
5705 up the 'current_class' and 'current_container', and pointing them
5706 to the enclosing class/container.
5707 (CSharpParser): Initialize 'current_class' too.
5708 * decl.cs (MemberCore): Add check for invariant: a partial
5709 container is not a parsed entity, and thus does not enclose any
5711 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5712 (DeclSpace.BaseTypeExpr): Use it.
5713 (DeclSpace.LookupType): Add check for invariant.
5714 * class.cs (TypeContainer): Add check for invariant: a nested
5715 class should have the same NamespaceEntry as its enclosing class.
5716 (TypeContainer.EmitFieldInitializers): Make virtual.
5717 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5719 (TypeContainer.Register): Remove.
5720 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5721 null. Use TypeResolveEmitContext for resolving base types and
5722 interfaces. Move initialization of Parts.TypeBuilder here from
5724 (TypeContainer.DefineNestedTypes): ... here.
5725 (PartialContainer): Take a Namespace not a NamespaceEntry.
5726 (PartialContainer.Create): Don't use Register. Call the
5727 appropriate Add... function directly.
5728 (ClassPart): Take both the PartialContainer and the enclosing
5729 class as constructor arguments.
5730 (ClassPart.EmitFieldInitializers): Override.
5731 (ClassPart.PartFindNestedTypes): Remove.
5732 (FieldBase.GetInitializerExpression): Resolve the initializer
5733 expression in the emit context of the enclosing class.
5734 * tree.cs (RootTypes): Remove Register ().
5736 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5738 * cs-parser.jay: Removed CS0134.
5740 * driver.cs: Removed CS1901.
5742 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5743 for predefined types.
5745 2005-03-07 Duncan Mak <duncan@novell.com>
5747 * codegen.cs (Save): Catch UnauthorizedAccessException as
5748 well. Fixes bug #73454.
5750 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5752 * cs-tokenizer.cs (xtoken): Add CS1035.
5754 * class.cs (MethodData.Define): Add CS0683.
5755 (FieldMember.ctor): Add CS0681.
5757 2005-03-07 Raja R Harinath <rharinath@novell.com>
5759 * ecore.cs (SimpleName.DoResolve): Rename from
5760 SimpleName.DoResolveAllowStatic.
5761 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5762 Pass 'intermediate' flag to MemberStaticCheck.
5763 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5764 of "intermediate" lookups via MemberAccess.
5765 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5766 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5768 2005-03-07 Raja R Harinath <rharinath@novell.com>
5771 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5772 slipped in because of variable names that are identical to a
5773 builtin type's BCL equivalent ('string String;', 'int Int32;').
5774 (PropertyExpr.EmitInstance): Likewise.
5776 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5778 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5780 * report.cs (warning_ignore_table): Made public.
5782 2005-03-04 Raja R Harinath <rharinath@novell.com>
5785 * class.cs (MethodData.Emit): Pass 'container' to
5786 container.GetObsoleteAttribute instead of 'container.Parent'.
5788 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5790 * cs-parser.jay: Add 1534 error test.
5792 * iterators.cs (Yield.CheckContext): Add error 1629.
5793 (Iterator.ctor): Save unsafe modifier.
5794 (MoveNextMethod.DoEmit): Restore unsafe context.
5796 * namespace.cs (UsingAlias): Better error message.
5798 2005-03-03 Dan Winship <danw@novell.com>
5800 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5801 the warning message [#73219]
5803 2005-03-03 Raja R Harinath <rharinath@novell.com>
5805 Fix compile with MCS 1.0.0.0.
5806 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5807 w_restore to not depend on string constant folding.
5809 2005-03-03 Raja R Harinath <rharinath@novell.com>
5811 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5812 CS0246 check to users who passed 'silent = false'.
5813 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5815 (SimpleName.SimpleNameResolve): Update.
5816 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5817 (MemberAccess.IdenticalNameAndTypeName): Update.
5818 * doc.cs (FindDocumentedTypeNonArray): Update.
5820 2005-03-03 Raja R Harinath <rharinath@novell.com>
5822 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5823 * parameters.cs (ComputeAndDefineParameters): Remove.
5824 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5825 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5826 Use GetParameterInfo.
5828 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5830 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5832 2005-03-02 Raja R Harinath <rharinath@novell.com>
5834 Unify DeclSpace.LookupType and DeclSpace.FindType.
5835 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5836 is in charge of defining nested types on demand.
5837 (DeclSpace.LookupType): Use it when the current_type is a
5838 TypeBuilder. Use LookupTypeDirect for reflected types.
5839 (DeclSpace.FindType): Remove.
5840 (DeclSpace.LookupInterfaceOrClass): Likewise.
5841 (DeclSpace.DefineTypeAndParents): Likewise.
5842 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5843 DeclSpace.LookupType.
5844 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5845 * typemanager.cs (LookupType): Simplify.
5846 (AddUserType): Remove type from negative_hits.
5847 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5848 * class.cs (TypeContainer.FindMembers): Move handling of nested
5850 (TypeContainer.FindMembers_NestedTypes): ... here.
5851 (TypeContainer.FindNestedType): Implement override.
5852 (ClassPart.FindNestedType): Delegate to PartialContainer.
5853 (ClassPart.PartFindNestedType): Looks up the nested types of the
5856 2005-04-14 Martin Baulig <martin@ximian.com>
5858 * generic.cs (ConstructedType): Moved all the type lookup and
5859 nested class logic into SimpleName.
5860 (ConstructedType.ResolveConstructedType): Our underlying type is
5861 already fully resolved; all the type lookup stuff is in
5864 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5865 constructed types here instead of in ConstructedType.
5867 * decl.cs (MemberName.GetTypeExpression): Always create a
5868 SimpleName, not a ConstructedType.
5869 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5871 2005-03-02 Martin Baulig <martin@ximian.com>
5873 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5874 static constructor in static classes.
5876 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5878 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5879 sizeParamIndex is not specified.
5881 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5884 * report.cs (WarningMessage.IsEnabled): Missing null check.
5886 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5888 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5889 in the fields and not in the properties.
5891 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5893 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5896 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5898 * attribute.cs: Small refactoring (improved robustness).
5899 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5900 (ValidateGuid): Removed.
5901 (Resolve): Removed referenced to above mentioned.
5902 (GetAttributeUsage): Made private and changed to work without
5904 (GetIndexerAttributeValue): Don't crash.
5905 (GetConditionalAttributeValue): Ditto.
5906 (GetClsCompliantAttributeValue): Ditto.
5907 (ExtractSecurityPermissionSet): All attributes exceptions are
5909 (GetPropertyValue): New helper.
5910 (GetMethodImplOptions): New method.
5911 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5912 some missing properties.
5914 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5915 (Method.ApplyAttributeBuilder): Updated.
5917 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5920 2005-02-28 Raja R Harinath <rharinath@novell.com>
5923 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5924 non-simple types (array, pointer, reference).
5926 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5928 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5930 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5932 (Method.CheckBase): Catch wrong destructor here.
5933 (MethodData.Define): Add errors 550, 668.
5935 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5937 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5939 * pending.cs (VerifyPendingMethods): Add error 551.
5941 * typemanager.cs (CSharpName): Next error report helper.
5943 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5945 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5946 attributes. Removed useless attribute double check.
5947 It saves almost 2MBs for corlib.
5949 2005-02-25 Raja R Harinath <rharinath@novell.com>
5952 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5953 called twice in case of error.
5955 2005-02-23 Chris Toshok <toshok@ximian.com>
5957 Fix compiler portions of #72827.
5958 * statement.cs (Block.Emit): call Begin/EndScope on the
5959 EmitContext instead of the ILGenerator.
5961 * codegen.cs (EmitContext.BeginScope): new method, call
5962 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5964 (EmitContext.BeginScope): same, but EndScope and CloseScope
5966 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5967 offset and call the superclass's OpenScope(int) with it.
5968 (SymbolWriter.CloseScope): get the current il
5969 offset and call superclass's CloseScope(int) with it.
5971 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5973 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5974 CS1677 for out and ref as well.
5976 * class.cs (Method.Define): Add error CS1599 detection.
5978 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5980 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5982 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5984 * support.cs.cs (ModifierDesc): New helper method.
5986 2005-02-23 Raja R Harinath <rharinath@novell.com>
5987 Abin Thomas <projectmonokochi@rediffmail.com>
5988 Anoob V E <projectmonokochi@rediffmail.com>
5989 Harilal P R <projectmonokochi@rediffmail.com>
5992 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5993 MemberLookup (used for error reporting) actually returns a result.
5994 Fix error report number (122, not 112).
5996 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5997 Anoob V E <projectmonokochi@rediffmail.com>
5998 Harilal P R <projectmonokochi@rediffmail.com>
6001 * pending.cs (PendingImplementation.GetAbstractMethods):
6002 Find NonPublic members too.
6004 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6006 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6009 * class.cs (MethodCore.CheckMethodAgainstBase):
6010 Add error 239 report.
6012 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6014 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6016 * class.cs (Operator.Define): Add error 217 report.
6018 2005-02-21 Raja R Harinath <rharinath@novell.com>
6021 * expression.cs (Invocation.IsApplicable): Make public.
6022 (Invocation.IsParamsMethodApplicable): Likewise.
6023 * delegate.cs (Delegate.VerifyApplicability): Don't use
6024 Invocation.VerifyArgumentCompat for parameter applicability
6025 testing. Use Invocation.IsApplicable and
6026 Invocation.IsParamsMethodApplicable.
6028 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6030 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6032 * class.cs (Operator.Define): Add error 217 report.
6034 2005-02-21 Raja R Harinath <rharinath@novell.com>
6036 * namespace.cs (UsingEntry.Resolve): Undo change below.
6038 2005-02-21 Raja R Harinath <rharinath@novell.com>
6041 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6042 disable the error message when the extended MemberLookup also
6044 (Expression.MemberLookupFinal): Update.
6045 (SimpleName.DoSimpleNameResolve): Update.
6046 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6047 Don't use MemberLookupFinal.
6048 (New.DoResolve): Update.
6049 (BaseAccess.CommonResolve): Update.
6051 2005-02-21 Raja R Harinath <rharinath@novell.com>
6054 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6055 occured previously, don't resolve again.
6057 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6060 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6061 argument. Call ResolveAttributeUsage for unresolved.
6062 when types doesn't match ctor arguments.
6064 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6065 for nested attribute classes.
6066 (Class.attribute_usage): Removed.
6067 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6068 for attribute class.
6070 * ecore.cs (IsAttribute): Removed.
6072 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6074 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6076 (attribute_types): Removed.
6077 (EmitCode): Global attributes are emited as the latest.
6079 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6081 * class.cs (EmitFieldInitializers): Don't emit field initializer
6082 for default values when optimilization is on.
6084 * constant.cs (Constant.IsDefaultValue): New property.
6086 * driver.cs: Add /optimize handling.
6090 * literal.cs: Implement new IsDefaultValue property.
6092 * rootcontext.cs (Optimize): New field, holds /optimize option.
6094 2005-02-18 Raja R Harinath <rharinath@novell.com>
6096 Fix crasher in re-opened #72347.
6097 * namespace.cs (Namespace.Lookup): Return null if
6098 DeclSpace.DefineType returns null.
6101 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6103 2005-02-18 Raja R Harinath <rharinath@novell.com>
6105 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6106 now returns null if it cannot resolve to an lvalue.
6107 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6108 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6109 returned null. Remove check for SimpleName.
6110 (EventExpr.DoResolveLValue): New.
6111 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6112 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6114 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6116 (Unary.ResolveOperator): Move CS0211 check ...
6117 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6119 (Unary.DoResolveLValue): Simplify.
6120 (AddressOf.DoResolveLValue): New.
6121 (ArrayAccess.DoResolveLValue): New.
6123 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6125 * attribute.cs (Attribute.Resolve): Add arguments casting for
6126 when types doesn't match ctor arguments.
6128 2005-02-16 Raja R Harinath <rharinath@novell.com>
6130 Fix parts of #63202.
6131 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6132 lookup of operator in base type. Ensure that all checks happen
6133 when the operator resolves to an "op_..." method.
6135 2005-02-15 Raja R Harinath <rharinath@novell.com>
6138 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6139 'ignore_cs0104' parameter. Pass it to ...
6140 (NamespaceEntry.Lookup): ... this.
6141 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6142 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6143 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6144 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6145 Update. Request that cs0104 errors be ignored.
6146 (ComposedCast.ResolveAsTypeStep): Update.
6148 2005-02-14 Raja R Harinath <rharinath@novell.com>
6151 * expression.cs (Invocation.BetterFunction): Remove support for
6152 comparing virtual functions and their overrides.
6153 (Invocation.IsOverride): New.
6154 (Invocation.OverloadResolve): Don't consider 'override' functions
6155 during candidate selection. Store them in a lookaside list.
6156 If the selected method is a 'virtual' function, use the list to
6157 find any overrides that are closer to the LHS type.
6159 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6161 * expression.cs (New.DoResolve): Add complex core type reduction.
6162 (New.Constantify): Converts complex core type syntax like 'new int ()'
6165 2005-02-14 Raja R Harinath <rharinath@novell.com>
6167 * decl.cs (EntryType.EntryType): New constructor to create an
6168 updated copy of a cache entry.
6169 (MemberCache.AddMethods): Use it.
6170 (MemberCache.ClearDeclaredOnly): Remove.
6171 (MemberCache.MemberCache): Update.
6173 2005-02-11 Miguel de Icaza <miguel@novell.com>
6175 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6176 variable. This one is represents the actual low-level declaration
6177 of the method, as opposed to the semantic level `IsStatic'.
6179 An anonymous method which is hosted into a static method might be
6180 actually an instance method. IsStatic would reflect the
6181 container, while MethodIsStatic represents the actual code
6184 * expression.cs (ParameterReference): Use the new MethodIsStatic
6185 instead of IsStatic.
6187 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6188 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6189 set on the current EmitContext.
6191 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6192 resolve our casted expression as an LValue. This triggers the
6193 proper LValue processing that is later required by Assign.
6197 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6199 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6201 C# 2.0 Fixed buffer implementation
6203 * anonymous.cs: Update after RegisterHelperClass renaming.
6205 * attribute.cs (AttributeTester.fixed_buffer_cache):
6206 Cache of external fixed buffers.
6207 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6208 implementation if field is fixed buffer else null.
6211 (TypeContainer.AddField): Accept FieldMember instead of Field.
6212 (FieldBase.IsFieldClsCompliant): Extracted code from
6213 VerifyClsCompliance descendant customization.
6214 (FixedField): New class handles fixed buffer fields.
6215 (FixedFieldExternal): Keeps information about imported fixed
6217 (IFixedField): Make access to internal or external fixed buffer
6220 * cs-parser.jay: Add fixed buffer parsing.
6222 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6225 * expression.cs (Indirection): Extended implementation to accept
6227 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6228 (ElementAccess.MakePointerAccess): Get type as parameter.
6229 (DoResolve): Add fixed buffer field expression conversion.
6230 (DoResolveLValue): Ditto.
6231 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6232 (ArrayPtr): Derives from FixedBufferPtr.
6233 (ArrayPtr.Emit): Add extra emit for array elements.
6235 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6237 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6238 for compiler generated types.
6239 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6241 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6242 and consume less memory.
6243 (Fixed.Resolve): Add fixed buffer case.
6245 * typemanager.cs (compiler_generated_attr_ctor,
6246 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6247 (HasElementType): Add our own implementation to work on every
6250 2005-02-11 Miguel de Icaza <miguel@novell.com>
6252 * anonymous.cs (CaptureContext): Track whether `this' has been
6255 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6256 only captured `this' if it was implicitly done (instance
6257 methods/variables were used).
6259 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6260 `this' must be captured.
6262 2005-01-30 Miguel de Icaza <miguel@novell.com>
6264 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6265 is null it means that there has been no need to capture anything,
6266 so we just create a sibling.
6268 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6270 Just a partial fix. The other half is fairly elusive.
6272 2005-02-10 Raja R Harinath <rharinath@novell.com>
6274 Fix #52586, cs0121-4.cs.
6275 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6276 and return a hashtable.
6277 (MemberCache.ClearDeclaredOnly): New.
6278 (MemberCache.MemberCache): Update to change. Make a deep copy of
6279 the method_hash of a base type too.
6280 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6281 type methods. Overwrite entries with the same MethodHandle so
6282 that the ReflectedType is correct. The process leaves in base
6283 virtual functions and their overrides as distinct entries.
6284 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6285 matters since it was boxed in a ArrayList before.
6286 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6288 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6289 case of a virtual function and its override (choose the overload
6291 (Invocation.OverloadResolve): Avoid 'override' members during
6292 'applicable_type' calculation.
6294 2005-03-28 Raja R Harinath <rharinath@novell.com>
6296 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6297 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6298 GetTypeHandle. It is possible for a reflected type to derive from
6299 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6300 System.Array during mscorlib compilation).
6301 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6302 contain a method_hash, don't create one either. Don't create a
6303 deep copy of the base cache's method_hash.
6304 (MemberCache.SetupCache): Rename back from DeepCopy.
6305 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6306 already initialized. If we see an override function, add its
6307 underlying base virtual function to the member_hash too.
6309 2005-02-09 Raja R Harinath <rharinath@novell.com>
6311 Combine two near-redundant caches.
6312 * typemanager.cs (method_params): Rename from method_internal_params.
6313 (TypeManager.GetParameterData): New. Replace
6314 Invocation.GetParameterData.
6315 (TypeManager.LookupParametersByBuilder): Remove.
6316 * expression.cs (Invocation.method_parameter_cache): Remove.
6317 (Invocation.GetParameterData): Remove.
6319 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6322 2005-02-08 Raja R Harinath <rharinath@novell.com>
6325 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6326 TypeManager.multicast_delegate_type is null, resolve it by looking
6327 up "System.MulticastDelegate".
6328 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6330 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6331 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6332 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6335 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6336 (LabeledStatement.AddReference): New. Set 'referenced'.
6337 (Goto.Resolve): Use it.
6339 2005-02-05 John Luke <john.luke@gmail.com>
6341 * driver.cs: remove duplicate -doc line in Usage ()
6343 2005-02-04 Raja R Harinath <rharinath@novell.com>
6345 * location.cs (Location.AddFile): Fix CS2002 error report.
6347 2005-02-02 Martin Baulig <martin@ximian.com>
6349 * delegate.cs (Delegate.DefineType): Report an internal error if
6350 TypeManager.multicast_delegate_type is null. See bug #72015 for
6353 2005-02-02 Raja R Harinath <rharinath@novell.com>
6355 Fix a crasher in a variant of #31984.
6356 * const.cs (Constant.CheckBase): New override that defers the
6357 new-or-override check in case the base type hasn't been populated
6359 (Constant.Define): Ensure the new-or-override check is performed.
6361 2005-02-01 Duncan Mak <duncan@ximian.com>
6363 * const.cs (LookupConstantValue): Check that `ce' is not null
6364 before calling GetValue ().
6366 2005-02-01 Raja R Harinath <rharinath@novell.com>
6368 Fix test-334.cs (#69519).
6369 * cs-parser.jay (using_alias_directive): Pass in an expression to
6370 NamespaceEntry.UsingAlias.
6371 (using_namespace_directive): Pass in an expression to
6372 NamespaceEntry.Using.
6373 (namespace_name): Don't flatten to a string.
6374 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6375 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6377 (NamespaceEntry.UsingEntry): Likewise.
6378 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6380 (NamespaceEntry.LookupForUsing): Remove.
6381 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6383 (NamespaceEntry.Lookup): Remove support for dotted names.
6385 2005-02-01 Raja R Harinath <rharinath@novell.com>
6387 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6389 (NamespaceEntry.ImplicitParent): Compute on demand.
6390 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6391 parallels the current.
6392 (NamespaceEntry.LookupForUsing): Use it.
6393 (NamespaceEntry.Lookup): If the current namespace-entry is
6394 implicit, don't search aliases and using tables.
6396 2005-02-01 Raja R Harinath <rharinath@novell.com>
6399 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6401 (TypeContainer.BaseCache): Compute on demand.
6402 (TypeContainer.FindMembers): Define constants and types if they're
6403 not already created.
6404 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6406 * const.cs (Constant.Define): Make idempotent.
6408 2005-01-29 Miguel de Icaza <miguel@novell.com>
6410 * pending.cs: Produce better code (no nops produced by using Ldarg
6413 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6414 i - 1' it should be arg + 1.
6418 2005-01-28 Raja R Harinath <rharinath@novell.com>
6420 * attribute.cs (Attribute.CheckAttributeType): Make private
6422 (Attribute.ResolveType): Make virtual.
6423 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6424 handling of RootContext.Tree.Types.
6426 2005-01-27 Raja R Harinath <rharinath@novell.com>
6428 Update attribute-handling to use the SimpleName/MemberAccess
6430 * cs-parser.jay (attribute): Pass in an expression to the
6431 constructors of Attribute and GlobalAttribute.
6432 * attribute.cs (Attribute): Take an expression for the name.
6433 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6434 passed in attribute name expression.
6435 (Attribute.CheckAttributeType): Use it.
6436 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6437 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6438 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6439 argument to prevent error messages if the lookup fails.
6441 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6443 * expression.cs (Indirection): Implemented IVariable interface
6444 to support indirection in AddressOf operator.
6445 (PointerArithmetic.Emit): Add optimalization for case where
6446 result can be precomputed.
6448 2005-01-26 Martin Baulig <martin@ximian.com>
6450 * class.cs (TypeContainer.AttributeTargets): Return the correct
6451 AttributeTargets depending on our `Kind' instead of throwing an
6452 exception; fixes #71632.
6454 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6457 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6460 2005-03-17 Martin Baulig <martin@ximian.com>
6462 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6463 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6465 2005-03-17 Martin Baulig <martin@ximian.com>
6467 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6468 to bool so we can return an error condition.
6469 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6472 2005-03-17 Martin Baulig <martin@ximian.com>
6474 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6476 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6477 converting from an array-type of T to `IEnumerable<T>'.
6479 2005-03-16 Martin Baulig <martin@ximian.com>
6481 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6482 (Nullable.LiftedUnaryMutator): New public class.
6484 * expression.cs (UnaryMutator.DoResolve): Added support for
6487 2005-03-14 Martin Baulig <martin@ximian.com>
6489 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6491 2005-03-14 Martin Baulig <martin@ximian.com>
6493 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6494 the comparision operators `<', `>', `<=' and `>='.
6496 2005-03-13 Martin Baulig <martin@ximian.com>
6499 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6500 avoid confusion with the `NullLiteral'.
6501 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6503 2005-03-13 Martin Baulig <martin@ximian.com>
6505 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6506 comparing arbitrary types with the null literal.
6508 2005-03-13 Martin Baulig <martin@ximian.com>
6510 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6511 boolean operators '&&', '||', '&' and '|'.
6512 (Nullable.OperatorTrueOrFalse): New public class.
6514 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6515 instead of a `StaticCallExpr'; added support for nullables.
6517 2005-03-10 Martin Baulig <martin@ximian.com>
6520 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6521 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
6523 2005-03-07 Martin Baulig <martin@ximian.com>
6525 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6526 it work if `expr' is not an IMemoryLocation.
6527 (Nullable.Lifted): Implement IMemoryLocation.
6528 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6531 2005-03-05 Martin Baulig <martin@ximian.com>
6533 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6534 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6535 (Nullable): Added support for lifted unary and binary operators.
6537 * expression.cs (Unary.DoResolve): Added support for nullable types.
6538 (Binary.DoResolve): Likewise.
6539 (Conditional.DoResolve): Likewise.
6541 2005-03-02 Martin Baulig <martin@ximian.com>
6543 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6545 * class.cs (ClassPart.SetParameterInfo): Override this.
6546 (PartialContainer.SetParameterInfo): Override this.
6547 (TypeContainer.CheckConstraints): New protected method.
6548 (PartialContainer.CheckConstraints): Override this and check
6549 whether the same contraints were specified in all parts of a
6550 partial generic type definition.
6551 (PartialContainer.UpdateConstraints): New public method.
6553 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6555 2005-03-02 Martin Baulig <martin@ximian.com>
6557 Committing a patch from Carlos Alberto Cortez to fix #72887.
6559 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6560 casts from `T []' to `int []'.
6562 2005-03-02 Martin Baulig <martin@ximian.com>
6564 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6566 * expression.cs (Binary.ResolveOperator): When resolving a
6567 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6568 `=='. Fixes #71866. See gen-127.cs.
6570 2005-03-02 Martin Baulig <martin@ximian.com>
6572 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6573 static constructor in static classes.
6575 2005-03-02 Martin Baulig <martin@ximian.com>
6578 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6579 (Nullable.LiftedConversion): Added support for user-defined
6582 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6584 * cs-parser.jay: Use ComposedCast everywhere instead of
6585 NullableType, so we don't need to check for NullableType
6587 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6588 case where we'll be resolved into a `parenthesized_expression_0'
6592 (Convert.UserDefinedConversion): Added nullable conversions.
6594 2005-02-28 Martin Baulig <martin@ximian.com>
6596 * generic.cs (TypeManager.IsNullableType): New static method.
6597 (Nullable): New abstract class.
6598 (Nullable.NullLiteral): New public class.
6599 (Nullable.LiftedConversion): New public class.
6601 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6602 `builtin_types opt_nullable'.
6605 (Convert.ImplicitConversionStandard): Added nullable conversions.
6606 (Convert.ExplicitConversionStandard): Likewise.
6607 (Convert.ExplicitConversion): Likewise.
6609 2005-02-26 Martin Baulig <martin@ximian.com>
6611 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6612 begin with a "?", for instance "?[]". Don't do a type lookup if
6615 2005-02-25 Martin Baulig <martin@ximian.com>
6617 The first part of Nullable Types :-)
6619 * generic.cs (NullableType): New public class.
6620 (NullCoalescingOperator): New public class.
6621 (TypeArguments.Resolve): Add a CS0306 check.
6623 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6624 (opt_nullable): New rule.
6625 (type): Added `opt_nullable' to `namespace_or_type_name',
6626 `builtin_types' and `pointer_type'.
6627 (array_type): Added `opt_nullable'.
6628 (opt_rank_specifier_or_nullable): New rule; this is the
6629 combination of `opt_rank_specifier' and `opt_nullable'.
6630 (opt_error): New rule; catch errors here.
6631 (nullable_type_or_conditional): New rule; we use this to check for
6632 nullable and still detect the conditional operator.
6633 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6634 instead `opt_rank_specifier'.
6636 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6639 2005-02-24 Martin Baulig <martin@ximian.com>
6641 * README, README.Changes: Removed; they're old and obsolete.
6643 2005-02-22 Martin Baulig <martin@ximian.com>
6645 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6646 returned an error, set `constraints' to null to avoid a crash
6648 (TypeParameter.ResolveType): Likewise.
6650 2005-02-22 Martin Baulig <martin@ximian.com>
6653 (Constraints.ResolveTypes): Protect against being called twice.
6654 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6655 (TypeParameter.ResolveType): New public method; calls
6656 constraints.ResolveTypes().
6657 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6658 into the new ResolveType().
6659 (GenericMethod.Define): Call ResolveType() on all our
6662 2005-02-21 Martin Baulig <martin@ximian.com>
6665 (TypeManager.generic_nullable_type): New static public field.
6666 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6669 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6671 2005-02-15 Martin Baulig <martin@ximian.com>
6673 * generic.cs (ConstructedType.Constraints): Correctly check
6674 constraints if the argument type is a type parameter; fixes
6677 2005-02-02 Martin Baulig <martin@ximian.com>
6679 * delegate.cs (Delegate.DefineType): Report an internal error if
6680 TypeManager.multicast_delegate_type is null. See bug #72015 for
6683 2005-01-29 Miguel de Icaza <miguel@novell.com>
6685 * pending.cs: Produce better code (no nops produced by using Ldarg
6688 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6689 i - 1' it should be arg + 1.
6693 2005-01-26 Martin Baulig <martin@ximian.com>
6695 * cs-parser.jay (indexer_declarator): Don't report an error if we
6696 have type parameters since we can be an explicit interface
6697 implementation; fixes #71449.
6699 2005-01-26 Martin Baulig <martin@ximian.com>
6701 * class.cs (TypeContainer.AttributeTargets): Return the correct
6702 AttributeTargets depending on our `Kind' instead of throwing an
6703 exception; fixes #71632.
6705 2005-01-26 Martin Baulig <martin@ximian.com>
6707 * delegate.cs (Delegate.DefineType): Correctly define our type
6708 parameters. Fixes #71483.
6710 2005-01-25 Raja R Harinath <rharinath@novell.com>
6713 * expression.cs (MemberAccess.DoResolve): Don't complain with
6714 cs0572 when the LHS of a member access has identical name and type
6717 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6720 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6722 Create custom PermissionSet only for PermissionSetAttribute.
6724 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6727 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6728 delegates in static class.
6730 2005-01-24 Martin Baulig <martin@ximian.com>
6732 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6733 merging an implicit block, just use its reachability.
6735 * statement.cs (Block.Resolve): Make the unreachable code check
6736 work wrt. implicit blocks; see test-337 from #63842.
6738 2005-01-21 Alp Toker <alp@atoker.com>
6740 * cs-parser.jay: destructor_declaration's container is PartialContainer
6741 not Class when partial types are used, so use Kind prop instead of
6744 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6746 * cs-parser.jay: Improve error reporting when an interface
6749 2005-01-20 Dick Porter <dick@ximian.com>
6751 * support.cs: SeekableStreamReader fix from Sandor Dobos
6752 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6753 chars are read. Fixes bug 70369.
6755 2005-01-20 Raja R Harinath <rharinath@novell.com>
6757 * cs-parser.jay (catch_clause): Simplify current_block handling
6760 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6762 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6763 code with ImplicitStandardConversion to handle the implicit
6764 conversion of method groups into valid delegate invocations.
6766 The problem is that in parameter handling we were using this code
6767 path. Fixes bug #64698
6769 2005-01-19 Raja R Harinath <rharinath@novell.com>
6771 * cs-parser.jay: Fix several infelicities.
6772 - Avoid assigning to the parser value stack. Code like
6773 '$3 = null' is unclean. Synthesize a value for the code block
6775 - Avoid using oob_stack for storing location information. Use ...
6776 (_mark_): ... this. New (empty) rule. Saves the current location
6778 (foreach_statement): Avoid using oob_stack for current_block
6779 handling. Use technique used in for_statement and
6780 using_statement. Synthesize a value for the code block to store
6781 additional intermediate information.
6783 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6785 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6786 of a different type is only allowed to private fields of a
6787 containing type, not on fields of a base class.
6789 See test-174.cs and error cs0122-9.cs
6791 2005-01-13 Raja R Harinath <rharinath@novell.com>
6793 Fix test-335.cs (bug #58126).
6794 * cs-parser.jay (argument): Split out non-expression parts of the
6795 rule into 'non_simple_argument'.
6796 (invocation_expression): Support parenthesized invocations with
6797 multiple arguments, and with single non-simple arguments.
6799 2005-01-13 Raja R Harinath <rharinath@novell.com>
6801 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6804 2005-01-12 Raja R Harinath <rharinath@novell.com>
6806 Fix cs0038-1.cs, cs1640-6.cs.
6807 * ecore.cs (Expression.Resolve): Remove special-case for
6808 SimpleName in error-handling.
6809 (Expression.almostMatchedMembers): Relax access permission to
6811 (Expression.MemberLookupFailed): Handle duplicates in
6812 almostMatchedMembers list.
6813 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6814 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6815 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6816 overload if the passed in MemberInfo is a MethodBase.
6818 2005-01-25 Martin Baulig <martin@ximian.com>
6821 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6823 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6826 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6827 for non-CAS & merge permission sets properly.
6829 2005-01-11 Raja R Harinath <rharinath@novell.com>
6831 Improve standard-compliance of simple name and member access
6832 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6833 * ecore.cs (FullNamedExpression): New abstract base class
6834 for Namespaces and TypeExpressions.
6835 (ResolveFlags.SimpleName): Remove.
6836 (SimpleName): Remove support for dotted names.
6837 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6838 DeclSpace.FindType and DeclSpace.LookupType.
6839 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6840 (Expression.ExprClassName): Make member function.
6841 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6842 a namespace. Remove creation of dotted "SimpleName"s.
6843 (MemberAccess.DoResolve): Likewise.
6844 * decl.cs (DeclSpace.Cache): Make private.
6845 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6846 (DeclSpace.FindType): Update.
6847 (DeclSpace.LookupType): Move here from RootContext. Return a
6848 FullNamedExpression.
6849 * namespace.cs (Namespace): Derive from FullNamedExpression
6850 so that it can be part of expression resolution.
6851 (Namespace.Lookup): Return an FullNamedExpression.
6852 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6854 * rootcontext.cs (NamespaceLookup): Remove.
6855 (LookupType): Move to DeclSpace.
6856 * attribute.cs (CheckAttributeType): Update.
6857 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6858 (FindDocumentedTypeNonArray): Likewise.
6860 2005-01-11 Raja R Harinath <rharinath@novell.com>
6862 Fix cs0509.cs, cs1632.cs.
6863 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6864 is the same as IsInterface.
6865 (TypeContainer.GetClassBases): Likewise.
6866 * statement.cs (LabeledStatement.ig): New field.
6867 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6869 (LabeledStatement.DoEmit): Check that the label was created with
6870 the same ILGenerator.
6872 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6875 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6876 accessors to its properties.
6878 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6879 from accessors to property.
6881 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6884 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6887 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6889 * attribute.cs: Check for null and empty strings.
6891 I have lost another battle to Paolo.
6893 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6896 * class.cs (PropertyMethod): Set Parent field in ctors.
6897 (SetMethod.InternalParameters): Add unsafe switch hack.
6898 Override MarkForDuplicationCheck where it is appropriate.
6900 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6901 It says whether container allows members with the same name.
6903 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6904 Removed is_method parameter.
6906 2005-01-06 Duncan Mak <duncan@ximian.com>
6908 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6909 because the previous change led to incorrect reporting of CS1032
6910 ("Cannot define/undefine preprocessor symbols after first token in
6911 file"). Instead of using `tokens_seen' as the only flag that
6912 triggers CS1040, introduce `comments_seen'. This new flag is used
6913 to signify having seen comments on the current line, so it is
6914 unset after a newline.
6916 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6918 * doc.cs : When searching for a type, find nested type too.
6919 This fixes bug #71040.
6921 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6924 - Warn missing member comment on those classes which also does not
6925 have doc comments. Fixed bug #71041.
6926 - Don't warn missing doc comment on default constructor.
6929 2005-01-06 Duncan Mak <duncan@ximian.com>
6931 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6932 comments, set `tokens_seen' to true. This allows us to detect
6933 misplaced preprocessor directives (i.e. not at the beginning of
6934 the a line, nor after whitespaces). In that case, report error
6935 CS1040. This fixes bug #56460.
6937 * cs-parser.jay (interface_member_declaration): Add checks for
6938 IsExplicitImpl, and report CS0541 error if an interface member is
6939 defined as an explicit interface declaration.
6941 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6944 * class.cs (PropertyMethod): Set Parent field in ctors.
6945 (SetMethod.InternalParameters): Add unsafe switch hack.
6947 * decl.cs (MemberCore.Parent): Cannot be readonly.
6949 2005-01-06 Raja R Harinath <rharinath@novell.com>
6951 * decl.cs (DeclSpace.ResolveType): Remove.
6952 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6953 Merge in code from ...
6954 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6955 * class.cs, enum.cs: Update to changes.
6957 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6959 * anonymous.cs: Ensure that we init the scope of our parent if it
6960 has not been initialized yet.
6962 2004-12-30 Duncan Mak <duncan@ximian.com>
6964 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6965 if field.FieldBuilder is null. Fixes #70758.
6967 * convert.cs: Fixed some typos and updated some of the comments.
6968 (ImplicitStandardConversionExists):
6969 (TryImplicitIntConversion): If `target_type' is an interface and
6970 the type of `ic' implements this interface, return true or a new
6971 BoxedCast instead of null. This fixes #70468.
6973 2004-12-29 Duncan Mak <duncan@ximian.com>
6975 * expression.cs (Argument.Emit): Check that Expr is
6976 IMemoryLocation before casting to it, and report CS1510 otherwise.
6980 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6982 * statement.cs (Block.ThisVariable): remove the recursion here, to
6983 make the --profile more sane.
6985 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6987 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6988 assembly, by JB Evain.
6990 2004-12-17 Raja R Harinath <rharinath@novell.com>
6992 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6993 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6994 "parent" refers to enclosing type/class. "base" refers to superclass.
6996 2004-12-17 Raja R Harinath <rharinath@novell.com>
6998 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6999 Ensure that we only have GlobalAttributes.
7000 * attribute.cs (Attribute.Emit): Make non-virtual.
7001 (GlobalAttribute.Emit): Remove.
7002 (Attribute.Resolve): Make virtual.
7003 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7004 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7005 the argument. Don't create one.
7006 (Attribute.GetObsoleteAttribute): Likewise.
7007 (Attribute.GetClsCompliantAttributeValue): Likewise.
7008 * class.cs, decl.cs: Update to changes.
7010 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7012 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7014 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7016 * statement.cs (Foreach.Resolve): Add error 186 report.
7018 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7020 * expression.cs (Conditional.DoResolve): Add warning 429.
7022 * statement.cs (If.Resolve): Add warning 665.
7024 2004-12-16 Raja R Harinath <rharinath@novell.com>
7026 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7027 except when in the parser, and in GlobalAttribute.
7028 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7029 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7030 RootContext.Tree.Types.NamespaceEntry once work is done.
7031 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7032 and resets RootContext.Tree.Types.NamespaceEntry.
7034 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7036 * cs-parser.jay: Don't create a block for every variable.
7038 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7040 * location.cs: Provide extra information.
7042 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7043 variables from the captured environment, it is the ldarg_0.
7045 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7047 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7050 * class.cs: Changed warning level for 169 to avoid developer
7051 displeasure from warning flooding. It will be changed back when they
7052 fix most of current BCL warnings.
7054 * RootContext.cs: Pushed default WarningLevel to 3.
7056 * statement.cs: Removed unused variable.
7058 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7060 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7061 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7062 Add error 502 report.
7063 (StaticClass.DefineType): Add error 441 report.
7064 (Class.AllowedModifiersProp): New virtual property as temporary
7065 extension to AllowedModifiers.
7066 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7067 to share implementation with StaticClass and don't call virtual
7070 * driver.cs (MainDriver): Add error 1558 test.
7072 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7073 report. Moved error 36 test here.
7075 * statement.cs (Throw.Resolve): Add error 724 report.
7077 * typemanager.cs: Add out_attribute_type core type.
7079 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7081 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7083 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7085 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7088 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7090 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7091 Add error 3023 report.
7092 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7094 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7097 2004-12-12 John Luke <john.luke@gmail.com>
7099 * driver.cs (AddArgs): take -- into account when
7100 adding arguments, fixes bug 65710
7102 2004-12-12 Martin Baulig <martin@ximian.com>
7104 * expression.cs (Unary.TryReduceNegative): Added support for
7105 SByteConstant and ByteConstant.
7106 (Unary.Reduce): Check error values from TryReduceNegative().
7108 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7110 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7111 and report exception as error 182.
7113 2004-12-10 Raja R Harinath <rharinath@novell.com>
7115 * driver.cs (Main): Fix message when there are warnings.
7117 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7119 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7121 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7123 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7124 Reduced number of warnings.
7126 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7128 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7130 * driver.cs: Removed message.
7132 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7134 2004-12-08 <vargaz@freemail.hu>
7136 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7138 2004-12-08 Martin Baulig <martin@ximian.com>
7140 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7141 instead of a CS3002 for properties and indexer.
7143 2004-12-08 Martin Baulig <martin@ximian.com>
7145 * decl.cs (MemberName.ToString): Make this work again.
7147 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7149 * attribute.cs (Resolve): Add error 591 detection.
7151 * class.cs (FieldMember.Define): Add error 1547 detection.
7152 (Indexer.Define): Add error 620 detection.
7153 (Operator.Define): Add error 590 detection.
7155 * ecore.cs: Missing argument for error 79.
7157 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7160 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7163 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7166 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7168 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7169 Some operator comments were suppressed.
7170 * doc.cs : Implicit/explicit operator name in doc comments are like
7171 "op_Explicit(type)~returnType", so added suffix handling.
7173 2005-01-21 Alp Toker <alp@atoker.com>
7175 * cs-parser.jay: destructor_declaration's container is PartialContainer
7176 not Class when partial types are used, so use Kind prop instead of 'is'.
7178 2004-12-12 Martin Baulig <martin@ximian.com>
7180 * expression.cs (Unary.TryReduceNegative): Added support for
7181 SByteConstant and ByteConstant.
7182 (Unary.Reduce): Check error values from TryReduceNegative().
7184 2004-12-11 Martin Baulig <martin@ximian.com>
7186 * support.cs (ReflectionParameters.ParameterName): If we have a
7187 `gpd', call `ParameterName' on it.
7189 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7191 * pending.cs (PendingImplementation.DefineProxy): Call
7192 DefineParameter() for all of the MethodBuilder's arguments.
7194 2004-12-09 Martin Baulig <martin@ximian.com>
7196 * doc.cs (DocUtil): Make this a static class.
7198 2004-12-09 Martin Baulig <martin@ximian.com>
7200 * expression.cs (Invocation.InferType): Moved the type inference
7201 implementation into TypeManager.
7203 * generics.cs (TypeManager): Moved the type inference
7204 implementation here.
7206 2004-12-09 Martin Baulig <martin@ximian.com>
7208 * typemanager.cs (TypeManager): Make this a partial class.
7211 (TypeManager): Move the generics part of `TypeManager' here.
7213 2004-12-08 Martin Baulig <martin@ximian.com>
7215 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7216 instead of a CS3002 for properties and indexer. Added CS3024
7217 check for generic interfaces.
7219 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7220 instances are not CLS-compliant.
7222 2004-12-08 Martin Baulig <martin@ximian.com>
7225 (void_pointer_expression): New rule for `void*', `void**' etc.
7226 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7228 2004-12-08 Martin Baulig <martin@ximian.com>
7230 * expression.cs (Invocation.InferType): Removed the hack for
7231 MethodCore.MayUnify().
7233 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7236 * class.cs (MethodCore.MayUnify): Use
7237 TypeManager.MayBecomeEqualGenericTypes().
7239 2004-12-08 Martin Baulig <martin@ximian.com>
7241 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7242 parameter, box it. Fixes #69233.
7244 2004-12-08 Martin Baulig <martin@ximian.com>
7246 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7247 have the ctor constraint. Fixes #68326.
7249 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7251 * cs-parser.jay : interface comment was not consumed because of
7252 extra opt_semicolon before doc handling.
7254 2004-12-03 Raja R Harinath <rharinath@novell.com>
7256 Fix test-327.cs, test-328.cs, and put in early infrastructure
7257 for eventually fixing #52697.
7258 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7259 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7261 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7262 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7263 (VerifyUsing, error246): Update.
7264 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7265 'NamespaceEntry.LookupNamespaceOrType'.
7267 2004-12-07 Martin Baulig <martin@ximian.com>
7269 * driver.cs: Call it "BETA SOFTWARE" :-)
7271 2004-12-06 Raja R Harinath <rharinath@novell.com>
7273 Fix crash on cs0657-17.cs.
7274 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7275 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7276 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7277 the case where the NamespaceEntry gets overwritten.
7279 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7281 Fixed #69195, #56821
7282 * ecore.cs (ResolveBoolean): Tiny refactoring.
7284 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7285 of right expression resolving when left is false constant and
7286 operator is LogicalAnd OR true constant and operator is LogicalOr.
7288 * statement.cs (ResolveUnreachable): Always reports warning.
7290 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7292 * class.cs: Distinguish between 1721 and 1722 (just a little help
7293 for the programmer).
7295 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7297 * delegate.cs: Only allow this on new versions of the language.
7299 2004-12-02 Duncan Mak <duncan@ximian.com>
7301 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7303 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7304 here as a static method. Take an additional bool out parameter
7305 `must_do_cs1540_check' for signaling to InstanceResolve.
7306 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7307 member field from PropertyExpr class and made it an argument of
7309 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7310 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7311 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7312 and `remove_accessor' as well as InstanceResolve: report CS0122
7317 2004-12-07 Martin Baulig <martin@ximian.com>
7319 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7320 and CS0692 where appropriate.
7322 2004-12-06 Martin Baulig <martin@ximian.com>
7324 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7325 IsDuplicateImplementation() and improved it.
7327 * expression.cs (Invocation.InferTypeArguments): Added
7328 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7329 and removed the "ref" modifier from `infered_types'.
7331 * decl.cs (MemberName.ToString): Removed the exception.
7333 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7335 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7336 comments are allowed.
7338 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7340 * delegate.cs: Add checks for subtypes in paramaters and return values
7341 in VerifyMethod () to add support for Covariance/Contravariance
7344 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7346 * report.cs: Remove extra closing parenthesis.
7348 * convert.cs (Error_CannotImplicitConversion): If the name of the
7349 types are the same, provide some extra information.
7351 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7354 * attribute.cs (Resolve): Improved implementation of params
7355 attribute arguments.
7357 * support.cs (ParameterData): Add HasParams to be faster.
7359 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7361 all things are for /doc support:
7363 * doc.cs: new file that supports XML documentation generation.
7364 * mcs.exe.sources: added doc.cs.
7366 Handle /doc command line option.
7367 Report error 2006 instead of 5 for missing file name for /doc.
7368 Generate XML documentation when required, after type resolution.
7370 Added support for picking up documentation (/// and /** ... */),
7371 including a new XmlCommentState enumeration.
7373 Added lines to fill Documentation element for field, constant,
7374 property, indexer, method, constructor, destructor, operator, event
7375 and class, struct, interface, delegate, enum.
7376 Added lines to warn incorrect comment.
7378 Added Documentation field (passed only when /doc was specified).
7380 Added DocComment, DocCommentHeader, GenerateDocComment() and
7381 OnGenerateDocComment() and some supporting private members for
7382 /doc feature to MemberCore.
7384 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7386 Added overriden DocCommentHeader.
7388 Added overriden DocCommentHeader and GenerateDocComment().
7390 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7392 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7393 unwrapping the enumeration values, chain to
7394 DoConstantNumericPromotions again, so we can promote things to the
7395 fundamental types (takes care of enums that are bytes, sbytes).
7399 2004-12-01 Raja R Harinath <rharinath@novell.com>
7401 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7402 Fix long-standing bug in type-lookup. Use FindType instead of
7403 LookupType when ec.ResolvingTypeTree.
7404 (Attribute.ResolveType, Attribute.Resolve)
7405 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7407 (Attributes.Search): Remove internal version. Update.
7408 (Attributes.SearchMulti): Update.
7409 (Attributes.GetClsCompliantAttribute): Remove.
7410 (Attributes.GetIndexerNameAttribute): Remove.
7411 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7412 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7413 * class.cs (Indexer.Define): Likewise.
7415 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7418 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7419 MarshallByReference members access.
7421 * expression.cs: Use CheckMarshallByRefAccess;
7422 Better error CS0197 message.
7424 * report.cs: Print whole related error message.
7426 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7428 * class (GetClassBases): Better error 60 report.
7429 (EventProperty): Disabled warning 67 detection.
7431 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7434 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7436 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7439 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7442 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7444 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7446 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7448 * attribute.cs (Attribute.Resolve): Refine error reporting and
7449 report a cs0117 if the identifier does not exist, to distinguish
7450 from 0617 which is a miss-use of the actual identifier.
7452 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7453 between cs0070 and cs0079.
7455 * class.cs (MemberBase.DoDefine): When reporting a wrong
7456 accessibility level, we use MethodCore to compare instead of
7457 Method (this was a regression in some refactoring effort).
7459 So now we correctly report cs0056 again.
7461 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7462 testing the target_type (which was known to be object_type) and
7463 not the source type (which is anonymous_method).
7465 Fixed reporting of error cs1660.
7467 * expression.cs (UserCast.Source): Expose the underlying cast.
7469 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7470 allowed types to find a match to int32 first (most common).
7472 In addition, it ignores any ImplicitUserConversions that did an
7473 internal implicit conversion (as the switch statement allows only
7474 one integral conversion to exist).
7476 * class.cs (PartialContainer.Create): rename `name' to
7477 `member_name' for clarity. Then replace the string calls with a
7478 call to MemberName.GetPartialName, as now using
7479 MemberName.ToString is an error (this is due to the side effects
7480 it had, that were fixed in the past).
7482 This will restore the error reporting on a number of partial class
7483 errors that were missusing this (and getting an exception as a
7484 results, which is now just a plain textual warning, because
7485 yyparse debug output would crash otherwise).
7487 2004-11-26 Raja R Harinath <rharinath@novell.com>
7489 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7491 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7493 * rootcontext.cs (LookupType): Make sure to cache lookups that
7494 don't give us a negative result. This saves about 5% of corlib
7497 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7499 * report.cs (AbstractMessage.Print): messages are sent to stderr
7501 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7502 non-interface in the list of interfaces (at this point, either
7503 parent was properly set, or a base class is being listed in the
7504 interfaces section).
7506 This flags error 1722, and resolves the crash from bug 69259.
7508 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7510 * statement.cs (Using.EmitExpressionFinally): make this work right
7511 for valuetypes. Fixes 69926.
7513 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7515 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7516 converted to an enum" here, before we try to change the underlying
7517 type. This code exists, but it is a different code path than the
7518 one used while encoding constants.
7520 (ImplicitReferenceConversionExists): In addition, resynchronized
7521 the code here, so it matches the same code in
7522 ImplicitReferenceConversionExists for the `from any class-type S
7523 to any interface-type T'.
7525 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7527 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7529 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7531 * cs-parser.jay: Use verbosity accordingly.
7533 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7535 * expression.cs (Unary.ResolveOperator): Do not report warning;
7536 AddressOf reads from variable.
7538 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7540 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7544 * attribute.cs (Attributable): Removed CheckTargets.
7545 (Attributes.Emit): Explicit attribute targets are tested here.
7547 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7548 not enabled for interfaces.
7550 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7551 (GetAssemblyName): Ouch next bug there.
7553 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7555 * expression.cs: Error 275 added.
7557 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7559 Fix bug #69177 (Implemented decimal constant support)
7561 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7562 (BinaryFold): Add DecimalConstant.
7564 * const.cs (Define): Decimal constant
7566 (ChangeType): Add decimal type handling.
7567 (LookupConstantValue): Don't set value for decimal type but
7568 emit DecimalConstantAttribute. Needed for constant optimization.
7570 * constant.cs (ToDecimal): New method.
7571 (ConvertToDecimal): New method.
7572 (IntConstant): Implemented ConvertToDecimal.
7573 (DecimalConstant.Emit): Emit optimized version for decimals in
7576 * expression.cs (ResolveOperator): Changed order of constant
7577 reduction to work correctly with native types which have
7578 overloaded operators.
7579 (ResolveMemberAccess): Extract constant value from attribute
7582 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7584 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7585 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7586 (ChangeType): Decimal is special.
7587 (TypeToCoreType): Add decimal type.
7589 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7591 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7594 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7596 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7599 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7601 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7603 * pending.cs (PendingImplementation): Grab only interfaces.
7605 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7607 * statement.cs (ForeachHelperMethods): Add location member and
7608 error 202 detection.
7610 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7612 * expression.cs (DoResolveBase): Fixed wrong warning for out
7615 2004-12-04 Martin Baulig <martin@ximian.com>
7617 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7618 to check whether the conversion is ok.
7620 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7621 `Type.EmptyTypes' if we're not a generic TypeContainer.
7623 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7625 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7626 old bug: when converting from the null literal to a pointer,
7627 return an EmptyCast, not the NullLiteral.
7629 This fixes #69921, the recent null_type changes probably made this
7632 2004-12-03 Martin Baulig <martin@ximian.com>
7634 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7635 method as our child, call AnonymousMethod.Compatible() on it.
7637 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7639 * class.cs (FieldBase): Use an unused bit field from the field to
7640 encode the `has_offset' property from the FieldMember. This saves
7641 a couple of Ks on bootstrap compilation.
7643 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7644 method as our child, return the AnonymousMethod resolved
7647 * expression.cs (New.DoResolve): Allow return values from
7648 NewDelegate to also include AnonymousMethods.
7652 2004-11-29 Raja R Harinath <rharinath@novell.com>
7654 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7656 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7657 System.Runtime.InteropServices._Exception, since it's a base
7658 interface of the core type System.Exception in the net_2_0 profile.
7660 2004-11-27 Martin Baulig <martin@ximian.com>
7662 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7664 2004-11-26 Raja R Harinath <rharinath@novell.com>
7666 * Makefile: Convert to use executable.make.
7667 * gmcs.exe.sources: New.
7669 2004-11-25 Martin Baulig <martin@ximian.com>
7671 * expression.cs (Invocation.InferType): Added support for byref types.
7673 2004-11-25 Martin Baulig <martin@ximian.com>
7675 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7676 in TypeManager.TypeToCoreType().
7678 2004-11-25 Martin Baulig <martin@ximian.com>
7680 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7681 "Dispose" method from the `current_type'.
7682 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7683 DoDefineMembers() instead of using the MethodBuilder; this is
7684 required for generic iterators.
7686 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7688 2004-11-24 Martin Baulig <martin@ximian.com>
7690 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7692 2004-11-20 Martin Baulig <martin@ximian.com>
7694 * expression.cs (Invocation.InferType): Correctly infer generic
7695 instances; see gen-103.cs.
7696 (Invocation.InferTypeArguments): If a generic method doesn't have
7697 any unbound type parameters, we don't need to infer anything.
7699 2004-11-19 Raja R Harinath <rharinath@novell.com>
7701 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7703 2004-11-17 Raja R Harinath <rharinath@novell.com>
7705 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7706 (TypeHandle.GetMemberCache): New.
7707 (TypeHandle.TypeHandle): Update.
7708 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7709 (TypeManager.LookupParentInterfacesCache):
7710 Rename from LookupInterfaceCache. Optimize slightly.
7711 (TypeManager.MemberLookup_FindMembers): Update.
7712 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7714 (AddCacheContents): Rename from AddHashtable.
7715 * class.cs (TypeContainer.parent_container): Remove.
7716 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7717 (TypeContainer.DoDefineMembers): Don't initialize it.
7718 Update to name changes.
7720 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7722 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7723 that factors the code to check access modifiers on override.
7725 (PropertyBase): Use the code here.
7727 Patch from Lluis S'anchez, fixes bug #69361.
7729 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7731 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7732 routine that is used to report the use of a captured variable
7733 whose address has been taken.
7735 There are two checks: one when variables are being captured and
7736 the other check is when the address of a variable is taken.
7738 (because an anonymous methods might be resolved before *or* after
7739 the address has been taken) and
7741 * expression.cs (Conditional.DoResolve): Remove the special
7742 casing that Martin added to trueExpr and falseExpr being both
7743 NullLiteral. We get the right behavior now just by introducing
7744 the null_type into the compiler.
7746 * convert.cs (ExplicitConversion): Change the code to use
7747 null_type instead of testing `expr is NullLiteral'.
7748 (ImplicitConversionStandard): use null_type too.
7749 (ImplicitReferenceConversionExists): use null_type too.
7750 (ImplicitReferenceConversion): use null_type too.
7752 * literal.cs: The type of `NullLiteral' is now null_type instead
7754 (Resolve): Set the type here.
7756 * typemanager.cs: Introduce null_type.
7758 2004-11-18 Martin Baulig <martin@ximian.com>
7761 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7763 2004-11-18 Martin Baulig <martin@ximian.com>
7765 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7767 2004-11-18 Martin Baulig <martin@ximian.com>
7769 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7770 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7771 call ResolveConstructedType() on it to resolve it without checking
7773 (Constraints.ResolveTypes): Check them here.
7774 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7775 but don't check constraints.
7776 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7777 check constraints here.
7778 (ConstructedType.ResolveConstructedType): New public method. This
7779 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7780 resolve ourselves without checking constraints.
7782 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7784 2004-11-18 Martin Baulig <martin@ximian.com>
7787 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7789 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7791 2004-11-18 Martin Baulig <martin@ximian.com>
7793 * ecore.cs (TypeExpr.ResolveType): Removed.
7794 (Expression.ResolveAsTypeTerminal): We always return a fully
7795 resolved `TypeExpr', so we can just access its `Type'.
7797 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7799 2004-11-17 Martin Baulig <martin@ximian.com>
7801 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7802 sure we don't return any unresolved TypeExpr's.
7803 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7805 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7807 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7808 unresolved `ConstructedType's.
7810 2004-11-17 Martin Baulig <martin@ximian.com>
7812 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7814 2004-11-17 Martin Baulig <martin@ximian.com>
7817 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7819 * decl.cs (DeclSpace.ResolveType): Removed.
7820 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7822 2004-11-17 Martin Baulig <martin@ximian.com>
7824 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7825 direction, like FindMembers() does. Fixes #69546, testcase is in
7828 2004-11-16 Martin Baulig <martin@ximian.com>
7830 This is based on a patch from Marek Safar, see bug #69082.
7831 Fixes bugs #63705 and #67130.
7833 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7834 method; create a MemberCache for an interface type and cache the
7837 * decl.cs (IMemberContainer.ParentContainer): Removed.
7838 (IMemberContainer.ParentCache): New property.
7839 (MemberCache.SetupCacheForInterface): Removed.
7840 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7841 to create a cache for an interface's "parent".
7843 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7846 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7848 * statement.cs: Avoid adding bools to a hashtable.
7850 2004-11-15 Martin Baulig <martin@ximian.com>
7852 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7854 2004-11-11 Martin Baulig <martin@ximian.com>
7856 * typemanager.cs (TypeManager.GetMethodName): New method.
7858 * class.cs (MethodData.Define): Include the generic arity in the
7859 name of an explicit interface; also add it to the method name.
7861 * pending.cs (PendingImplementation.InterfaceMethod): The method
7862 name now includes the generic arity.
7864 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7866 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7867 calling an unsafe method from a safe location.
7869 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7872 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7874 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7876 * namespace.cs (VerifyUsing): use GetPartialName instead of
7879 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7881 * statement.cs (Return.Resolve): Fix regression in typo: if
7882 `in_exc', we have to request a NeedReturnLabel, this was a typo
7883 introduced in the anonymous method check-in. Fixes #69131.
7885 * Indexers were using the ShortName when defining themselves,
7886 causing a regression in the compiler bootstrap when applying the
7887 patch from 2004-11-02 (first part), now they use their full name
7888 and the bug is gone.
7890 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7892 * driver.cs: Strip the path from the names of embedded resources. Fixes
7895 2004-11-04 Raja R Harinath <rharinath@novell.com>
7897 Fix error message regression: cs0104-2.cs.
7898 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7899 (AliasEntry.Resolve): Update.
7900 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7902 (RootContext.LookupType): Update.
7904 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7906 * cs-parser.jay: Add support for handling accessor modifiers
7907 * class: Add support port accessor modifiers and error checking,
7908 define PropertyMethod.Define as virtual (not abstract anymore)
7909 * ecore.cs: Add checking for proeprties access with access modifiers
7910 * iterators.cs: Modify Accessor constructor call based in the modified
7912 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7914 * expression.cs (StringConcat): Handle being called twice,
7915 as when we have a concat in a field init with more than two
7918 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7920 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7921 special case explicit implementations, we should always produce
7922 the .property or .event declaration.
7924 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7925 since it will not return correct data if people use this
7926 unresolved in the presence of using statements (see test-313).
7928 * class.cs (MethodData.Define): If we are an explicit interface
7929 implementation, set the method name to the full name of the
7930 interface plus the name of the method.
7932 Notice that using the method.MethodName.GetFullName() does not
7933 work, as it will only contain the name as declared on the source
7934 file (it can be a shorthand in the presence of using statements)
7935 and not the fully qualifed type name, for example:
7939 class D : ICloneable {
7940 object ICloneable.Clone () {
7944 Would produce a method called `ICloneable.Clone' instead of
7945 `System.ICloneable.Clone'.
7947 * namespace.cs (Alias.Resolve): Use GetPartialName.
7949 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7951 * cs-parser.jay: Add error 1055 report.
7953 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7955 * assign.cs (Assign.DoResolve): Only do the transform of
7956 assignment into a New if the types are compatible, if not, fall
7957 through and let the implicit code deal with the errors and with
7958 the necessary conversions.
7960 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7962 * cs-parser.jay: Add error 1031 report.
7964 * cs-tokenizer.cs: Add location for error 1038.
7966 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7968 * cs-parser.jay: Add error 1016 report.
7970 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7972 * cs-parser.jay: Add errors 1575,1611 report.
7974 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7976 * cs-parser.jay: Add error 1001 report.
7978 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7981 * attribute.cs (GetMarshal): Add method argument for
7982 caller identification.
7984 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7985 agument for GetMarshal and RuntimeMissingSupport.
7987 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7989 * attribute.cs (ExtractSecurityPermissionSet): Removed
7990 TypeManager.code_access_permission_type.
7992 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7994 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7996 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7997 for obsolete use of a variable here. Fixes regression on errors
7998 cs0619-25 and cs0619-26.
8000 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8002 Fix #62358, implemented security attribute encoding.
8004 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8005 Tests permitted SecurityAction for assembly or other types.
8006 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8007 data from SecurityPermissionAttribute to PermisionSet class.
8009 * class.cs (ApplyAttributeBuilder): Added special handling
8010 for System.Security.Permissions.SecurityAttribute based types.
8012 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8013 special handling for System.Security.Permissions.SecurityAttribute
8016 * enum.cs (ApplyAttributeBuilder): Added special handling
8017 for System.Security.Permissions.SecurityAttribute based types.
8019 * parameter.cs (ApplyAttributeBuilder): Added special handling
8020 for System.Security.Permissions.SecurityAttribute based types.
8022 * rootcontext.cs: Next 2 core types.
8024 * typemanager.cs (TypeManager.security_permission_attr_type):
8025 Built in type for the SecurityPermission Attribute.
8026 (code_access_permission_type): Build in type.
8028 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8030 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8031 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8032 all of this information into
8033 EmitContext.EmitCapturedVariableInstance.
8035 * codegen.cs (EmitCapturedVariableInstance): move here the
8036 funcionality of emitting an ldarg.0 in the presence of a
8037 remapping. This centralizes the instance emit code.
8039 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8040 then emit a load of this: it means that we have reached the
8041 topmost ScopeInfo: the one that contains the pointer to the
8042 instance of the class hosting the anonymous method.
8044 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8045 captures to the topmost CaptureContext.
8047 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8049 * expression.cs (LocalVariableReference): Move the knowledge about
8050 the iterators into codegen's EmitCapturedVariableInstance.
8052 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8054 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8055 all code paths return a value from an anonymous method (it is the
8056 same as the 161 error, but for anonymous methods).
8058 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8060 The introduction of anonymous methods in the compiler changed
8061 various ways of doing things in the compiler. The most
8062 significant one is the hard split between the resolution phase
8063 and the emission phases of the compiler.
8065 For instance, routines that referenced local variables no
8066 longer can safely create temporary variables during the
8067 resolution phase: they must do so from the emission phase,
8068 since the variable might have been "captured", hence access to
8069 it can not be done with the local-variable operations from the runtime.
8073 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8074 is a toplevel block.
8076 (ToplevelBlock): A new kind of Block, these are the blocks that
8077 are created by the parser for all toplevel method bodies. These
8078 include methods, accessors and anonymous methods.
8080 These contain some extra information not found in regular blocks:
8081 A pointer to an optional CaptureContext (for tracking captured
8082 local variables and parameters). A pointer to the parent
8085 (Return.Resolve): Catch missmatches when returning a value from an
8086 anonymous method (error 1662).
8087 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8090 (Break.Resolve): ditto.
8092 (SwitchLabel): instead of defining the labels during the
8093 resolution phase, we now turned the public ILLabel and ILLabelCode
8094 labels into methods called GetILLabelCode() and GetILLabel() that
8095 only define the label during the Emit phase.
8097 (GotoCase): Track the SwitchLabel instead of the computed label
8098 (its contained therein). Emit the code by using
8099 SwitchLabel.GetILLabelCode ().
8101 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8102 whether the Local has been captured or not.
8104 (LocalInfo.IsCaptured): New property, used to tell whether the
8105 local has been captured.
8107 * anonymous.cs: Vastly updated to contain the anonymous method
8110 The main classes here are: CaptureContext which tracks any
8111 captured information for a toplevel block and ScopeInfo used to
8112 track the activation frames for various local variables.
8114 Each toplevel block has an optional capture context associated
8115 with it. When a method contains an anonymous method both the
8116 toplevel method and the anonymous method will create a capture
8117 context. When variables or parameters are captured, they are
8118 recorded on the CaptureContext that owns them, for example:
8122 MyDelegate d = delegate {
8127 Here `a' will be recorded as captured on the toplevel
8128 CapturedContext, the inner captured context will not have anything
8129 (it will only have data if local variables or parameters from it
8130 are captured in a nested anonymous method.
8132 The ScopeInfo is used to track the activation frames for local
8133 variables, for example:
8135 for (int i = 0; i < 10; i++)
8136 for (int j = 0; j < 10; j++){
8137 MyDelegate d = delegate {
8142 At runtime this captures a single captured variable `i', but it
8143 captures 10 different versions of the variable `j'. The variable
8144 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8145 recorded on a child.
8147 The toplevel ScopeInfo will also track information like the `this'
8148 pointer if instance variables were referenced (this is necessary
8149 as the anonymous method lives inside a nested class in the host
8150 type of the method).
8152 (AnonymousMethod): Expanded to track the Toplevel, implement
8153 `AnonymousMethod.Compatible' to tell whether an anonymous method
8154 can be converted to a target delegate type.
8156 The routine now also produces the anonymous method content
8158 (AnonymousDelegate): A helper class that derives from
8159 DelegateCreation, this is used to generate the code necessary to
8160 produce the delegate for the anonymous method that was created.
8162 * assign.cs: API adjustments for new changes in
8163 Convert.ImplicitStandardConversionExists.
8165 * class.cs: Adjustments to cope with the fact that now toplevel
8166 blocks are of type `ToplevelBlock'.
8168 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8169 insteda of standard blocks.
8171 Flag errors if params arguments are passed to anonymous methods.
8173 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8174 `CurrentAnonymousMethod' which points to the current Anonymous
8175 Method. The variable points to the AnonymousMethod class that
8176 holds the code being compiled. It is set in the new EmitContext
8177 created for the anonymous method.
8179 (EmitContext.Phase): Introduce a variable and an enumeration to
8180 assist in enforcing some rules about when and where we are allowed
8181 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8182 only one that enfonces this right now).
8184 (EmitContext.HaveCaptureInfo): new helper method that returns
8185 whether we have a CapturedContext initialized.
8187 (EmitContext.CaptureVariable): New method used to register that a
8188 LocalInfo must be flagged for capturing.
8190 (EmitContext.CapturedParameter): New method used to register that a
8191 parameters must be flagged for capturing.
8193 (EmitContext.CapturedField): New method used to register that a
8194 field must be flagged for capturing.
8196 (EmitContext.HaveCapturedVariables,
8197 EmitContext.HaveCapturedFields): Return whether there are captured
8198 variables or fields.
8200 (EmitContext.EmitMethodHostInstance): This is used to emit the
8201 instance for the anonymous method. The instance might be null
8202 (static methods), this (for anonymous methods that capture nothing
8203 and happen to live side-by-side with the current method body) or a
8204 more complicated expression if the method has a CaptureContext.
8206 (EmitContext.EmitTopBlock): Routine that drives the emission of
8207 code: it will first resolve the top block, then emit any metadata
8208 and then emit the code. The split is done so that we can extract
8209 any anonymous methods and flag any captured variables/parameters.
8211 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8212 during this phase, the ILGenerator should not be used as labels
8213 and local variables declared here might not be accessible to any
8214 code that is part of an anonymous method.
8216 Exceptions to this include the temporary variables that are
8217 created by some statements internally for holding temporary
8220 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8223 (EmitContext.TemporaryReturn): This method is typically called
8224 from the Emit phase, and its the only place where we allow the
8225 ReturnLabel to be defined other than the EmitMeta. The reason is
8226 that otherwise we would have to duplicate a lot of logic in the
8227 Resolve phases of various methods that today is on the Emit
8230 (EmitContext.NeedReturnLabel): This no longer creates the label,
8231 as the ILGenerator is not valid during the resolve phase.
8233 (EmitContext.EmitThis): Extended the knowledge in this class to
8234 work in anonymous methods in addition to iterators.
8236 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8237 code is necessary on the stack to access the instance to a local
8238 variable (the variable will be accessed as a field).
8240 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8241 EmitContext.EmitAddressOfParameter): Routines to support
8242 parameters (not completed at this point).
8244 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8245 will also remove the parameters.
8247 * convert.cs (Convert): Define a `ConstantEC' which points to a
8248 null. This is just to prefity some code that uses
8249 ImplicitStandardConversion code and do not have an EmitContext
8252 The idea is to flag explicitly that at that point in time, it is
8253 known that the conversion will not trigger the delegate checking
8254 code in implicit conversions (which requires a valid
8257 Everywhere: pass new EmitContext parameter since
8258 ImplicitStandardConversionExists now requires it to check for
8259 anonymous method conversions.
8261 (Convert.ImplicitStandardConversionExists): If the type of an
8262 expression is the anonymous_method_type, and the type is a
8263 delegate, we invoke the AnonymousMethod.Compatible method to check
8264 whether an implicit conversion is possible.
8266 (Convert.ImplicitConversionStandard): Only do implicit method
8267 group conversions if the language level is not ISO_1.
8269 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8270 MethodInfo for the Invoke method. used by Delegate and
8273 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8274 method conversions if the target type is a delegate.
8276 Removed extra debugging nops.
8278 (LocalVariableReference): Turn the `local_info' into a public
8281 Add `prepared' field, the same hack used for FieldExprs to cope
8282 with composed assignments, as Local variables do not necessarily
8283 operate purely on the stack as they used to: they can be captured
8286 Add `temp' for a temporary result, like fields.
8288 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8290 It now copes with Local variables that are captured and emits the
8291 proper instance variable to load it from a field in the captured
8294 (ParameterReference.DoResolveBase): During the resolve phase,
8295 capture parameters if we are in an anonymous method.
8297 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8298 anonymous method, use the EmitContext helper routines to emit the
8299 parameter reference.
8301 * iterators.cs: Set RemapToProxy to true/false during the
8304 * parameters.cs (GetParameterByName): New helper method.
8306 * typemanager.cs (anonymous_method_type) a new type that
8307 represents an anonyous method. This is always an internal type,
8308 used as a fencepost to test against the anonymous-methodness of an
8311 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8313 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8315 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8317 2004-11-10 Martin Baulig <martin@ximian.com>
8319 * expression.cs (Invocation.BetterFunction): If two methods have
8320 equal parameter types, but only one of them is generic, the
8321 non-generic one wins.
8322 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8323 instance; just use `Type.IsValueType' to determine whether
8324 something is a struct or not.
8325 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8326 so we can be called multiple times.
8328 2004-11-10 Martin Baulig <martin@ximian.com>
8330 * generic.cs (TypeParameter.DefineConstraints): New public method.
8331 (TypeParameter.CheckAccessLevel): Override this and return true.
8332 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8333 override ResolveType() anymore.
8334 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8336 2004-11-10 Martin Baulig <martin@ximian.com>
8338 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8339 call DeclSpace.ResolveNestedType() on it.
8341 2004-11-10 Martin Baulig <martin@ximian.com>
8343 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8344 non-null, call ParameterModifier() on it.
8346 2004-11-10 Martin Baulig <martin@ximian.com>
8349 (Iterators): Added `current_type' and `this_type' fields.
8350 (Iterators.DefineIterator): Create a new EmitContext and store it
8351 in `ec'; compute `this_type'.
8353 2004-11-10 Martin Baulig <martin@ximian.com>
8356 (TypeManager.IsPrivateAccessible): New public method.
8357 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8359 2004-11-10 Martin Baulig <martin@ximian.com>
8361 * class.cs (TypeContainer.DefineType): Call
8362 TypeBuilder.DefineGenericParameters() before resolving the type
8364 (MethodData.parent_method): New protected field.
8365 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8366 (MethodData.Define): Compute `parent_method'.
8369 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8370 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8371 (DeclSpace.ec): New protected field; store the EmitContext here.
8372 (DeclSpace.EmitContext): New public property.
8373 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8374 (DeclSpace.ResolveNestedType): New public method.
8375 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8376 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8377 (DeclSpace.FamilyAccessible): Likewise.
8378 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8379 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8382 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8385 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8386 (Enum.Emit): Don't create a new EmitContext.
8388 2004-10-18 Martin Baulig <martin@ximian.com>
8390 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8391 `Type' directly, but call ResolveType() on it.
8392 (Catch.Resolve): Likewise.
8393 (Foreach.Resolve): Likewise.
8395 2004-10-18 Martin Baulig <martin@ximian.com>
8397 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8398 `Type' directly, but call ResolveType() on it.
8399 (Probe.DoResolve): Likewise.
8400 (ArrayCreation.LookupType): Likewise.
8401 (TypeOf.DoResolve): Likewise.
8402 (SizeOf.DoResolve): Likewise.
8404 2004-10-18 Raja R Harinath <rharinath@novell.com>
8406 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8409 2004-10-17 John Luke <john.luke@gmail.com>
8411 * class.cs (Operator.GetSignatureForError): use CSharpName
8413 * parameter.cs (Parameter.GetSignatureForError): Returns
8414 correct name even if was not defined.
8416 2004-10-13 Raja R Harinath <rharinath@novell.com>
8419 * class.cs (TypeContainer.EmitContext): New property.
8420 (DefineNestedTypes): Create an emitcontext for each part.
8421 (MethodCore.DoDefineParameters): Use container's emitcontext.
8422 Pass type array to InternalParameters.
8423 (MemberBase.DoDefine): Use container's emitcontext.
8424 (FieldMember.Define): Likewise.
8425 (Event.Define): Likewise.
8426 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8427 Pass type array to InternalParameters.
8428 (SetIndexerMethod.GetParameterInfo): Likewise.
8429 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8430 * delegate.cs (Define): Pass emitcontext to
8431 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8432 array to InternalParameters.
8433 * expression.cs (ParameterReference.DoResolveBase): Pass
8434 emitcontext to GetParameterInfo.
8435 (ComposedCast.DoResolveAsTypeStep): Remove check on
8436 ec.ResolvingTypeTree.
8437 * parameter.cs (Parameter.Resolve): Change argument to
8438 EmitContext. Use ResolveAsTypeTerminal.
8439 (Parameter.GetSignature): Change argument to EmitContext.
8440 (Parameters.ComputeSignature): Likewise.
8441 (Parameters.ComputeParameterTypes): Likewise.
8442 (Parameters.GetParameterInfo): Likewise.
8443 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8444 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8445 * support.cs (InternalParameters..ctor): Remove variant that takes
8447 * typemanager.cs (system_intptr_expr): New.
8448 (InitExpressionTypes): Initialize it.
8450 2004-10-12 Chris Toshok <toshok@ximian.com>
8452 * cs-parser.jay: fix location for try_statement and catch_clause.
8454 2004-10-18 Martin Baulig <martin@ximian.com>
8456 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8457 `Type' directly, but call ResolveType() on it.
8458 (MemberBase.DoDefine): Likewise.
8460 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8461 `Type' directly, but call ResolveType() on it.
8462 (ComposedCast.DoResolveAsTypeStep): Likewise.
8464 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8465 `Type' directly, but call ResolveType() on it.
8467 2004-10-17 John Luke <john.luke@gmail.com>
8469 * class.cs (Operator.GetSignatureForError): use CSharpName
8471 * parameter.cs (Parameter.GetSignatureForError): Returns
8472 correct name even if was not defined.
8474 2004-10-13 Raja R Harinath <rharinath@novell.com>
8477 * class.cs (TypeContainer.EmitContext): New property.
8478 (DefineNestedTypes): Create an emitcontext for each part.
8479 (MethodCore.DoDefineParameters): Use container's emitcontext.
8480 Pass type array to InternalParameters.
8481 (MemberBase.DoDefine): Use container's emitcontext.
8482 (FieldMember.Define): Likewise.
8483 (Event.Define): Likewise.
8484 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8485 Pass type array to InternalParameters.
8486 (SetIndexerMethod.GetParameterInfo): Likewise.
8487 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8488 * delegate.cs (Define): Pass emitcontext to
8489 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8490 array to InternalParameters.
8491 * expression.cs (ParameterReference.DoResolveBase): Pass
8492 emitcontext to GetParameterInfo.
8493 (ComposedCast.DoResolveAsTypeStep): Remove check on
8494 ec.ResolvingTypeTree.
8495 * parameter.cs (Parameter.Resolve): Change argument to
8496 EmitContext. Use ResolveAsTypeTerminal.
8497 (Parameter.GetSignature): Change argument to EmitContext.
8498 (Parameters.ComputeSignature): Likewise.
8499 (Parameters.ComputeParameterTypes): Likewise.
8500 (Parameters.GetParameterInfo): Likewise.
8501 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8502 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8503 * support.cs (InternalParameters..ctor): Remove variant that takes
8505 * typemanager.cs (system_intptr_expr): New.
8506 (InitExpressionTypes): Initialize it.
8508 2004-10-12 Chris Toshok <toshok@ximian.com>
8510 * cs-parser.jay: fix location for try_statement and catch_clause.
8512 2004-10-07 Raja R Harinath <rharinath@novell.com>
8514 More DeclSpace.ResolveType avoidance.
8515 * decl.cs (MemberCore.InUnsafe): New property.
8516 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8517 with newly created EmitContext.
8518 (FieldMember.Define): Likewise.
8519 * delegate.cs (Delegate.Define): Likewise.
8520 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8521 only if normal name-lookup fails.
8522 (TypeExpr.DoResolve): Enable error-checking.
8523 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8524 (SizeOf.DoResolve): Likewise.
8525 (ComposedCast.DoResolveAsTypeStep): Likewise.
8526 (StackAlloc.DoResolve): Likewise.
8527 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8528 (Block.Unsafe): New property.
8529 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8530 (Unsafe): Set 'unsafe' flag of contained block.
8531 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8532 (Fixed.Resolve): Likewise.
8533 (Catch.Resolve): Likewise.
8534 (Using.ResolveLocalVariableDecls): Likewise.
8535 (Foreach.Resolve): Likewise.
8537 2004-10-05 John Luke <john.luke@gmail.com>
8539 * cs-parser.jay: add location to error CS0175
8541 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8543 * ecore.cs (Expression.Constantity): Add support for turning null
8546 * const.cs (Const.Define): Allow constants to be reference types
8547 as long as the value is Null.
8549 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8551 * namespace.cs (NamespaceEntry.Using): No matter which warning
8552 level is set, check if this namespace name has already been added.
8554 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8556 * expression.cs: reftype [!=]= null should always use br[true,false].
8559 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8562 * attribute.cs: Enum conversion moved to
8563 GetAttributeArgumentExpression to be applied to the all
8566 2004-10-01 Raja R Harinath <rharinath@novell.com>
8568 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8569 * class.c (TypeContainer.DefineType): Flag error if
8570 base types aren't accessible due to access permissions.
8571 * decl.cs (DeclSpace.ResolveType): Move logic to
8572 Expression.ResolveAsTypeTerminal.
8573 (DeclSpace.ResolveTypeExpr): Thin layer over
8574 Expression.ResolveAsTypeTerminal.
8575 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8576 Refactor code into NestedAccess. Use it.
8577 (DeclSpace.NestedAccess): New.
8578 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8579 argument to silence errors. Check access permissions.
8580 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8581 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8582 (Cast.DoResolve): Likewise.
8583 (New.DoResolve): Likewise.
8584 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8585 (TypeOf.DoResolve): Likewise.
8587 * expression.cs (Invocation.BetterConversion): Return the Type of
8588 the better conversion. Implement section 14.4.2.3 more faithfully.
8589 (Invocation.BetterFunction): Make boolean. Make correspondence to
8590 section 14.4.2.2 explicit.
8591 (Invocation.OverloadResolve): Update.
8592 (Invocation): Remove is_base field.
8593 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8594 (Invocation.Emit): Likewise.
8596 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8598 * cs-parser.jay: Reverted 642 warning fix.
8600 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8603 * decl.cs (FindMemberWithSameName): Indexer can have more than
8606 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8608 * expression.cs (LocalVariableReference.DoResolveLValue):
8609 Do not report warning 219 for out values.
8610 (EmptyExpression.Null): New member to avoid extra allocations.
8612 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8614 * cs-parser.jay: Fix wrong warning 642 report.
8616 * cs-tokenizer.cs (CheckNextToken): New helper;
8617 Inspect next character if is same as expected.
8619 2004-09-23 Martin Baulig <martin@ximian.com>
8621 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8622 (Convert.ImplicitReferenceConversionExists): Likewise.
8624 2004-11-09 Raja R Harinath <rharinath@novell.com>
8626 * Makefile (DISTFILES): Comment out a few missing files.
8628 2004-10-29 Raja R Harinath <rharinath@novell.com>
8630 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8631 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8632 (gmcs.exe): Invoke bootstrap-libs.
8633 (clean-local): Clean the net_2_0_bootstrap profile too.
8634 (PROGRAM_INSTALL_DIR): New.
8635 (install-local): Use it.
8637 2004-10-13 Martin Baulig <martin@ximian.com>
8639 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8640 (TypeParameter.DefineType): If we're a method type parameter and
8641 that method is overriding something, "inflate" its constraints.
8643 2004-10-12 Martin Baulig <martin@ximian.com>
8645 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8646 and have type arguments, create and resolve a ConstructedType.
8648 2004-10-12 Martin Baulig <martin@ximian.com>
8650 * decl.cs (MemberCache.FindMemberToOverride): Use
8651 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8652 to compare the invocationType.
8654 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8655 When comparing two type parameters, only do the signature-only
8656 comparision for method type parameters.
8658 2004-10-11 Martin Baulig <martin@ximian.com>
8660 * report.cs: Don't make --fatal abort on warnings, we have
8661 -warnaserror for that.
8663 2004-10-11 Martin Baulig <martin@ximian.com>
8666 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8667 (TypeManager.IsEqual): Call ourself recursively instead of using
8670 2004-10-11 Martin Baulig <martin@ximian.com>
8672 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8673 on our own type parameters, not on the ones we inherit from a containing
8676 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8679 * generic.cs (TypeParameter.Define): We may only be called once.
8681 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8682 instead of TypeManager.IsEqual().
8684 2004-09-28 Martin Baulig <martin@ximian.com>
8687 (GenericConstraints.EffectiveBaseClass): New public property.
8688 (TypeParameter.GenericConstraints): New public property.
8689 (ConstructedType.CheckConstraints): Improved.
8691 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8692 (Convert.TypeParameterConversion): New private method; use this in
8693 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8694 for all conversions related to type parameters.
8696 2004-09-24 Martin Baulig <martin@ximian.com>
8698 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8699 type parameter conversions for type parameters which are known to
8702 2004-09-24 Martin Baulig <martin@ximian.com>
8704 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8705 `IsValueType' properties.
8707 * support.cs (ReflectionConstraints): Use
8708 Type.GetGenericParameterConstraints() instead of the old hack.
8710 2004-09-24 Martin Baulig <martin@ximian.com>
8712 * generic.cs (GenericConstraints): Moved here and made it an
8715 * support.cs (GenericConstraints): Moved to generic.cs.
8717 2004-09-24 Martin Baulig <martin@ximian.com>
8720 (ReflectionConstraints): Un-nested this class and made it public.
8723 (TypeManager.GetTypeParameterConstraints): New public method.
8724 (TypeManager.HasConstructorConstraint): Use the attributes.
8726 2004-09-24 Martin Baulig <martin@ximian.com>
8728 * support.cs (GenericConstraints): Replaced `HasConstructor',
8729 `IsReferenceType' and `IsValueType' with `Attributes'.
8730 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8731 method and made the .ctor public.
8733 * generic.cs (Constraints.Attributes): New public property.
8734 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8735 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8736 `IsValueType' -> `HasValueTypeConstraint'.
8738 2004-09-23 Martin Baulig <martin@ximian.com>
8740 * generic.cs (Constraints): Reflect latest runtime changes.
8742 2004-09-23 Martin Baulig <martin@ximian.com>
8744 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8745 (Convert.ImplicitReferenceConversionExists): Likewise.
8747 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8749 * class.cs (Operator.Define): Add error 448 and 559 report.
8751 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8753 * class.cs (MemberBase.IsTypePermitted): New protected
8754 method for checking error CS0610.
8756 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8758 * class.cs (TypeContainer.HasExplicitLayout): New property
8759 Returns whether container has StructLayout attribute set Explicit.
8760 (FieldMember): New abstract class for consts and fields.
8761 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8762 (Field): Reuse FieldMember.
8764 * const.cs (Const): Reuse FieldMember.
8766 * rootcontext.cs: EmitConstants call moved to class.
8768 2004-09-22 Martin Baulig <martin@ximian.com>
8770 Marek and me just fixed one of our oldest bugs: #28562 :-)
8772 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8774 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8775 we're an EnumConstant, just return that.
8776 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8777 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8778 to get the value which'll actually be written into the attribute.
8779 However, we have to use GetValue() to access the attribute's value
8782 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8784 * constant.cs (Constant.IsNegative): New abstract property
8787 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8788 (StackAlloc.DoResolve): Reused IsNegative.
8790 2004-09-22 Martin Baulig <martin@ximian.com>
8792 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8793 public method; like LookupTypeContainer, but also works for
8796 * report.cs (Report.SymbolRelatedToPreviousError): Use
8797 TypeManager.LookupGenericTypeContainer().
8799 2004-09-22 Martin Baulig <martin@ximian.com>
8801 Thanks to Peter Sestoft for this bug report.
8803 * expression.cs (Conditional): If both the `trueExpr' and the
8804 `falseExpr' is a NullLiteral, return a NullLiteral.
8806 2004-09-22 Martin Baulig <martin@ximian.com>
8808 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8809 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8810 for the "get_Current" call.
8812 2004-09-21 Martin Baulig <martin@ximian.com>
8814 * convert.cs (Convert.ImplicitReferenceConversion): When
8815 converting to an interface type, first check whether we're
8816 converting from a reference type.
8818 2004-09-14 Martin Baulig <martin@ximian.com>
8820 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8822 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8825 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8826 called and is obsolete then this member suppress message
8827 when call is inside next [Obsolete] method or type.
8829 * expression.cs: Use TestObsoleteMethodUsage member.
8831 2004-09-14 Martin Baulig <martin@ximian.com>
8833 * genericparser.cs: Removed.
8835 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8837 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8839 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8841 * attribute.cs (Attribute.Resolve): Add error 653 report.
8843 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8845 (Method.ApplyAttributeBuilder): Add error 685 report.
8846 (Operator.Define): Add error 564 report.
8848 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8850 * expression.cs (Invocation.DoResolve): Add error
8853 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8856 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8858 * class.cs (ConstructorInitializer.Resolve):
8859 Wrong error number (515->516).
8861 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8863 * class.cs (Indexer.Define): Add error 631 report.
8865 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8867 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8869 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8871 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8873 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8875 * cs-parser.jay: Added error CS0241 report.
8877 2004-09-10 Raja R Harinath <rharinath@novell.com>
8879 * cs-parser.jay (fixed_statement): Introduce a scope for the
8880 declaration in the 'fixed' statement.
8882 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8884 * cs-parser.jay: Added CS0230 error report.
8886 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8888 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8890 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8892 * expression.cs (Argument.Resolve): Added error CS0192 and
8895 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8897 C# 2.0 #pragma warning feature
8899 * cs-tokenizer.cs (PreProcessPragma): New method;
8900 Handles #pragma directive.
8902 * report.cs (WarningRegions): New class; Support
8903 class for #pragma warning directive. It tests whether
8904 warning is enabled for a given line.
8906 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8908 * const.cs: Add more descriptive error report, tahnks to
8911 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8913 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8915 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8917 * expression.cs: Apply patch from Ben: Remove dead code from
8918 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8919 as that code just threw an exception anwyays.
8921 * const.cs: Remove the call to the turnintoconstant, for details
8924 * literal.cs: The type of the null-literal is the null type; So
8925 we use a placeholder type (literal.cs:System.Null, defined here)
8928 * expression.cs (Conditional.DoResolve): Remove some old code that
8929 is no longer needed, conversions have been fixed.
8931 (ArrayCreationExpression.DoResolve): Return false if we fail to
8932 resolve the inner expression.
8934 2004-09-07 Raja R Harinath <rharinath@novell.com>
8937 * cs-parser.jay (delegate_declaration): Record a delegate
8938 declaration as a type declaration.
8939 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8941 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8943 * parameter.cs: Do not crash if the type can not be resolved.
8945 * expression.cs: Report errors with unsafe pointers, fixes #64896
8947 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8949 * expression.cs: Pointer arith always needs to do a conv.i
8950 if the operand is a long. fix 65320
8952 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8954 Fixed cs0619-37.cs, cs0619-38.cs
8956 * enum.cs (GetObsoleteAttribute): Removed.
8958 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8959 on Enum member is double staged. The first is tested member
8962 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8964 Fixed #56986, #63631, #65231
8966 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8967 adds member to name container.
8968 (TypeContainer.AddToTypeContainer): New method, adds type to
8970 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8971 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8972 AddOperator): Simplified by reusing AddToMemberContainer.
8973 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8975 (Method.CheckForDuplications): Fixed implementation to test all
8977 (MemberBase): Detection whether member is explicit interface
8978 implementation is now in constructor.
8979 (MemberBase.UpdateMemberName): Handles IndexerName.
8980 (Accessor): Changed to keep also location information.
8981 (AbstractPropertyEventMethod): Is derived from MemberCore.
8982 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8983 will be emited or not.
8984 (PropertyBase.AreAccessorsDuplicateImplementation):
8985 Tests whether accessors are not in collision with some method.
8986 (Operator): Is derived from MethodCore to simplify common
8989 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8991 (DeclSpace.AddToContainer): Adds the member to defined_names
8992 table. It tests for duplications and enclosing name conflicts.
8994 * enum.cs (EnumMember): Clean up to reuse the base structures
8996 2004-09-03 Martin Baulig <martin@ximian.com>
8998 Merged latest changes into gmcs. Please keep this comment in
8999 here, it makes it easier for me to see what changed in MCS since
9000 the last time I merged.
9002 2004-09-03 Martin Baulig <martin@ximian.com>
9004 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9005 into TypeContainer, to make partial classes work again.
9007 2004-09-03 Martin Baulig <martin@ximian.com>
9009 * rootcontext.cs (RootContext.V2): Removed.
9011 2004-03-23 Martin Baulig <martin@ximian.com>
9013 * expression.cs (Invocation.OverloadResolve): Added `bool
9014 may_fail' argument and use it instead of the Location.IsNull() hack.
9016 2004-09-09 Martin Baulig <martin@ximian.com>
9018 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9020 2004-09-09 Martin Baulig <martin@ximian.com>
9022 * generic.cs (TypeParameter.DefineType): Added support for
9023 explicit interface methods.
9025 2004-09-09 Martin Baulig <martin@ximian.com>
9027 * README.Changes: New document. Started to list important changes
9028 between MCS and GMCS here.
9030 2004-09-08 Martin Baulig <martin@ximian.com>
9033 (TypeContainer.CheckRecursiveDefinition): New protected method.
9034 (TypeContainer.DefineType): Move the CS0146 check into
9035 CheckRecursiveDefinition().
9037 2004-09-06 Martin Baulig <martin@ximian.com>
9039 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9040 types for the constructor constraint.
9042 2004-09-03 Martin Baulig <martin@ximian.com>
9044 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9045 into TypeContainer, to make partial classes work again.
9047 2004-09-03 Martin Baulig <martin@ximian.com>
9049 * rootcontext.cs (RootContext.V2): Removed.
9051 2004-03-23 Martin Baulig <martin@ximian.com>
9053 * expression.cs (Invocation.OverloadResolve): Added `bool
9054 may_fail' argument and use it instead of the Location.IsNull() hack.
9056 2004-09-03 Martin Baulig <martin@ximian.com>
9058 Merged latest changes into gmcs. Please keep this comment in
9059 here, it makes it easier for me to see what changed in MCS since
9060 the last time I merged.
9062 2004-09-03 Raja R Harinath <rharinath@novell.com>
9065 * expression.cs (BetterConversion): Don't allow either conversion
9066 to be null. Remove redundant implicit conversion test when 'q ==
9067 null' -- when this function is invoked, we already know that the
9068 implicit conversion exists.
9069 (BetterFunction): Assume that 'best' is non-null. Remove
9070 redundant reimplementation of IsApplicable when 'best' is null.
9071 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9072 number of arguments.
9073 (IsAncestralType): Extract from OverloadResolve.
9074 (OverloadResolve): Make robust to the MethodGroupExpr being
9075 unsorted. Implement all the logic of Section 14.5.5.1, and
9076 support overloading of methods from multiple applicable types.
9077 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9079 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9080 (RealError, Warning): Append type of report to related symbol.
9082 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9084 * enum.cs: Fixed CLS-Compliance checks for enum members.
9085 Error tests cs3008-8.cs, cs3014-8.cs
9087 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9089 Fixed bug #62342, #63102
9090 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9091 like ImplementMethod.
9093 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9095 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9098 2004-09-02 Martin Baulig <martin@ximian.com>
9100 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9101 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9104 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9106 C# 2.0 Static classes implemented
9108 * class.cs (TypeContainer): instance_constructors,
9109 initialized_fields, initialized_static_fields,
9110 default_constructor, base_inteface_types are protected to be
9111 accessible from StaticClass.
9112 (TypeContainer.DefineDefaultConstructor): New virtual method
9113 for custom default constructor generating
9114 (StaticClass): New class to handle "Static classes" feature.
9116 * cs-parser.jay: Handle static keyword on class like instance
9119 * driver.cs: Added "/langversion" command line switch with two
9120 options (iso-1, default).
9122 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9124 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9126 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9128 * delegate.cs: Style.
9130 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9132 * delegate.cs: Add seperate instance expr field for miguel.
9134 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9136 * PointerArithmetic (Resolve): make sure we are not doing
9137 pointer arith on void*. Also, make sure we are resolved
9138 by not setting eclass until resolve.
9140 All callers: Make sure that PointerArithmetic gets resolved.
9142 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9144 * ArrayCreation (LookupType): If the type does not resolve
9145 to an array, give an error.
9147 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9149 * statement.cs (Try.Resolve): Fixed bug #64222
9151 2004-08-27 Martin Baulig <martin@ximian.com>
9154 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9157 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9159 * ecore.cs (Constantify): Get underlying type via
9160 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9161 Windows in special cases.
9163 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9165 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9166 for obtaining also private methods.
9167 (GetRemoveMethod): Used GetRemoveMethod (true)
9168 for obtaining also private methods.
9170 2004-09-02 Martin Baulig <martin@ximian.com>
9172 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9173 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9176 2004-08-27 Martin Baulig <martin@ximian.com>
9179 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9182 2004-08-25 Martin Baulig <martin@ximian.com>
9184 * support.cs (ReflectionParameters..ctor): If this is a generic
9185 method, retrieve and store its type parameters.
9186 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9187 (ReflectionParameters.GenericConstraints): The argument specifies
9188 the type parameter, not the method parameter.
9189 (InternalParameters.GenericConstraints): Likewise.
9191 * generic.cs (TypeParameter.DefineType): Correctly handle
9192 constraints wrt. generic methods in interfaces and their
9195 2004-08-24 Martin Baulig <martin@ximian.com>
9197 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9198 (Constraints.IsSubclassOf): New internal method.
9200 * typemanager.cs (TypeManager.FindMembers): Added special support
9201 for GenericTypeParameterBuilder's.
9202 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9205 2004-08-24 Martin Baulig <martin@ximian.com>
9208 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9209 this for accessibility checks.
9210 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9211 IsNestedFamilyAccessible.
9212 (TypeManager.IsSubclassOf): New method, do what the name actually
9215 2004-08-24 Martin Baulig <martin@ximian.com>
9217 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9218 as a SimpleName, include the generic arity.
9220 2004-08-24 Martin Baulig <martin@ximian.com>
9222 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9223 MethodAttributes.HideBySig for operators.
9225 2004-08-23 Martin Baulig <martin@ximian.com>
9227 Back to the old error reporting system :-)
9229 * report.cs (Message): Removed.
9230 (Report.MessageData, ErrorData, WarningData): Removed.
9231 (Report.Error, Warning): Back to the old system.
9233 2004-08-23 Martin Baulig <martin@ximian.com>
9235 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9237 * class.cs (TypeContainer.ParentContainer): New public virtual
9238 method; replaces the explicit interface implementation.
9239 (ClassPart.ParentContainer): Override.
9241 2004-08-23 Martin Baulig <martin@ximian.com>
9243 * statement.cs (Switch): Added support for constant switches; see
9244 #59428 or test-285.cs.
9246 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9249 * statement.cs (GetEnumeratorFilter): Removed useless
9250 logic because C# specs is strict. GetEnumerator must be
9253 2004-08-22 Martin Baulig <martin@ximian.com>
9255 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9256 a switch and may break, reset the barrier. Fixes #59867.
9258 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9260 CLS-Compliance speed up (~5% for corlib)
9262 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9263 New method. Tests container for CLS-Compliant names
9265 * class.cs (TypeContainer.VerifyClsName): New method.
9266 Checks whether container name is CLS Compliant.
9267 (Constructor): Implements IMethodData.
9269 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9270 low-case table for CLS Compliance test.
9271 (MemberCache.VerifyClsParameterConflict): New method.
9272 Checks method parameters for CS3006 error.
9274 * enum.cs (EnumMember): Is derived from MemberCore.
9275 (Enum.VerifyClsName): Optimized for better performance.
9277 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9279 * report.cs: Renamed Error_T to Error and changed all
9282 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9284 * class.cs (TypeContainer.IndexerArrayList): New inner class
9285 container for indexers.
9286 (TypeContainer.DefaultIndexerName): New constant for default
9287 indexer name. Replaced all "Item" with this constant.
9288 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9290 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9291 DefaultMemberAttribute constructor.
9293 2004-08-05 Martin Baulig <martin@ximian.com>
9295 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9298 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9300 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9301 multi platforms problem.
9303 * compiler.csproj: Included shared files.
9305 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9307 Fix bug 60333, 55971 in the more general way
9308 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9309 Added arg_type argument for constant conversion.
9310 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9312 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9315 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9316 OperatorArrayList, MethodCoreArrayList for typecontainer
9317 containers. Changed class member types to these new types.
9318 (MethodArrayList.DefineMembers): Added test for CS0659.
9320 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9322 * cfold.cs: Synchronize the folding with the code in expression.cs
9323 Binary.DoNumericPromotions for uint operands.
9325 * attribute.cs: Revert patch from Raja, it introduced a regression
9326 while building Blam-1.2.1 (hard to isolate a test case).
9328 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9332 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9334 (MethodCore.parent_method): New member. The method we're overriding
9335 if this is an override method.
9336 (MethodCore.CheckBase): Moved from Method class and made common.
9337 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9339 (MethodCore.CheckForDuplications): New abstract method. For custom
9340 member duplication search in a container
9341 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9342 method and its return type.
9343 (Event.conflict_symbol): New member. Symbol with same name in the
9347 (MemberCache.FindMemberWithSameName): New method. The method
9348 is looking for conflict with inherited symbols.
9350 2004-08-04 Martin Baulig <martin@ximian.com>
9352 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9354 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9356 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9358 * report.cs (Message): New enum for better error, warning reference in
9360 (MessageData): New inner abstract class. It generally handles printing of
9361 error and warning messages.
9362 Removed unused Error, Warning, Message methods.
9364 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9366 Fix for cs0592-8.cs test
9368 (Attributable.ValidAttributeTargets): Made public.
9369 (Attribute.ExplicitTarget): New member for explicit target value.
9370 (Attribute.CheckTargets): Now we translate explicit attribute
9371 target to Target here.
9373 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9375 * ecore.cs (MethodGroupExpr): new IsBase property.
9377 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9379 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9380 rather than an instance expr.
9382 (DelegateCreation.Emit): Use the method group rather than
9383 the instance expression. Also, if you have base.Foo as the
9384 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9386 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9388 (NewDelegate.DoResolve): Only check for the existance of Invoke
9389 if the method is going to be needed. Use MethodGroupExpr.
9391 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9393 * expression.cs: For pointer arith., make sure to use
9394 the size of the type, not the size of the pointer to
9397 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9400 * class.cs (Class): Added error CS0502 test.
9402 2004-08-03 John Luke <jluke@cfl.rr.com>
9403 Raja R Harinath <rharinath@novell.com>
9406 * attribute.cs (Attribute.complained_before): New flag.
9407 (Attribute.ResolveType, Attribute.Resolve),
9408 (Attribute.DefinePInvokeMethod): Set it.
9409 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9411 2004-08-03 Martin Baulig <martin@ximian.com>
9413 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9414 use a user-defined operator; we still need to do numeric
9415 promotions in case one argument is a builtin type and the other
9416 one has an implicit conversion to that type. Fixes #62322.
9418 2004-08-18 Martin Baulig <martin@ximian.com>
9420 * class.cs (Method.Define): Use the correct method name when
9421 creating the MethodBuilder for a generic method.
9423 2004-08-17 Martin Baulig <martin@ximian.com>
9425 * generic.cs (Constraints): Support type parameter constraints.
9427 2004-08-16 Martin Baulig <martin@ximian.com>
9429 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9430 (Token.GENERIC_DIMENSION): New token; this is returned if we
9431 encounter an unbound generic type in a typeof() expression.
9433 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9434 this token is only generated while parsing a typeof() expression.
9435 (typeof_expression): Removed the old unbound_type hack.
9437 * generic.cs (TypeArguments.IsUnbound): New public property.
9439 * decl.cs (MemberName): Added support for unbound types.
9441 2004-08-14 Martin Baulig <martin@ximian.com>
9444 (TypeManager.IsEqualGenericInstance): New static method.
9445 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9446 just used to check accessibility, so follow the rules of 26.1.6.
9448 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9449 ConstructedType instead of a TypeExpression if we have type arguments.
9451 * cs-parser.jay (typeof_expression): Support unbound generic types.
9453 * ecore.cs (UnboundTypeExpression): New public class.
9455 2004-08-12 Martin Baulig <martin@ximian.com>
9457 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9458 TypeManager.IsEqual() rather than `=='.
9460 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9461 generic instances as well.
9463 2004-08-12 Martin Baulig <martin@ximian.com>
9465 * expression.cs (Invocation.InferType): We can only infer method
9466 type parameters. Fixes #62647.
9468 2004-08-11 Martin Baulig <martin@ximian.com>
9470 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9471 before resolving the base classes.
9473 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9475 * Makefile: install .mdb file too.
9477 2004-08-05 Martin Baulig <martin@ximian.com>
9479 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9480 initializer, the current type is just the TypeBuilder, not the
9481 instantiated generic type.
9482 (FieldExpr.IsFieldInitializer): New public property.
9484 2004-08-04 Martin Baulig <martin@ximian.com>
9486 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9488 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9490 2004-08-03 Martin Baulig <martin@ximian.com>
9492 * class.cs (MethodData.Define): If we're an explicit
9493 implementation, remove the generic arity from the type name.
9495 2004-08-03 Martin Baulig <martin@ximian.com>
9497 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9498 use a user-defined operator; we still need to do numeric
9499 promotions in case one argument is a builtin type and the other
9500 one has an implicit conversion to that type. Fixes #62322.
9502 2004-08-02 Martin Baulig <martin@ximian.com>
9504 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9506 (TypeContainer.GetClassBases): Return the unexpanded list of
9507 interfaces; we expand them later.
9508 (TypeContainer.DefineType): After creating the TypeBuilder, call
9509 TypeManager.ExpandInterfaces() to get an expanded and resolved
9512 * ecore.cs (TypeExpr.GetInterfaces): Removed
9514 * generics.cs (Constraints.InterfaceConstraints): Remove.
9515 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9516 register the interface constraints.
9519 (TypeManager.AddUserType): Removed the `ifaces' argument.
9520 (TypeManager.AddTypeParameter): Likewise.
9521 (TypeManager.AddUserInterface): Removed, was unused.
9522 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9523 `TypeExpr[]' array for the interfaces.
9524 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9525 has been defined, returns a list of the resolved interfaces types.
9526 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9527 (TypeManager.GetExplicitInterfaces): Likewise.
9529 2004-08-02 Martin Baulig <martin@ximian.com>
9531 * expression.cs (Invocation.EmitCall): If we're invoking a method
9532 on a type parameter, use the new `Constrained' prefix opcode.
9534 2004-08-02 Martin Baulig <martin@ximian.com>
9536 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9537 (LocalInfo.IsThis): New public property.
9538 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9540 2004-08-01 Martin Baulig <martin@ximian.com>
9542 * class.cs (TypeContainer.GetClassBases): Don't set the default
9543 here since we may get called from GetPartialBases().
9544 (TypeContainer.DefineType): If GetClassBases() didn't return a
9545 parent, use the default one.
9547 2004-07-30 Martin Baulig <martin@ximian.com>
9549 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9551 * class.cs (SourceMethod): New public class, derive from the
9552 symbol writer's ISourceMethod.
9553 (Method): Use the new symbol writer API.
9555 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9556 as argument and use the new symbol writer.
9559 (SourceFile): Implement the symbol writer's ISourceFile.
9560 (Location.SymbolDocument): Removed.
9561 (Location.SourceFile): New public property.
9563 * symbolwriter.cs: Use the new symbol writer API.
9565 2004-07-30 Raja R Harinath <rharinath@novell.com>
9567 * Makefile (install-local): Remove. Functionality moved to
9570 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9572 * Makefile: Install mcs.exe.config file together with mcs.exe.
9573 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9574 correct runtime version.
9576 2004-07-25 Martin Baulig <martin@ximian.com>
9579 (TypeContainer.RegisterOrder): Removed, this was unused.
9580 (TypeContainer, interface_order): Removed.
9581 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9582 TypeContainer as argument since we can also be called with a
9583 `PartialContainer' for a partial class/struct/interface.
9584 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9585 of checking whether we're an `Interface' - we could be a
9587 (PartialContainer.Register): Override; call
9588 AddClass()/AddStruct()/AddInterface() on our parent.
9590 * cs-parser.jay (interface_member_declaration): Add things to the
9591 `current_container', not the `current_class'.
9593 * rootcontext.cs (RegisterOrder): The overloaded version which
9594 takes an `Interface' was unused, removed.
9596 * typemanager.cs (TypeManager.LookupInterface): Return a
9597 `TypeContainer', not an `Interface'.
9598 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9599 contain a `PartialContainer' for an interface, so check it's
9600 `Kind' to figure out what it is.
9602 2004-07-25 Martin Baulig <martin@ximian.com>
9604 * class.cs (Class.DefaultTypeAttributes): New public constant.
9605 (Struct.DefaultTypeAttributes): Likewise.
9606 (Interface.DefaultTypeAttributes): Likewise.
9607 (PartialContainer.TypeAttr): Override this and add the
9608 DefaultTypeAttributes.
9610 2004-07-25 Martin Baulig <martin@ximian.com>
9612 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9613 we can just use the `Parent' field instead.
9615 2004-07-25 Martin Baulig <martin@ximian.com>
9617 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9619 2004-07-25 Martin Baulig <martin@ximian.com>
9621 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9622 our parts before defining any methods.
9623 (TypeContainer.VerifyImplements): Make this virtual.
9624 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9625 on our PartialContainer.
9627 2004-07-25 Martin Baulig <martin@ximian.com>
9629 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9631 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9632 argument, we can just use the `Parent' field instead.
9635 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9636 (MemberBase.DoDefine): Likewise.
9638 2004-07-24 Martin Baulig <martin@ximian.com>
9640 * decl.cs (MemberCore.Parent): New public field.
9641 (DeclSpace.Parent): Moved to MemberCore.
9643 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9644 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9646 (FieldBase, Field, Operator): Likewise.
9647 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9648 (EventField, Event): Likewise.
9650 2004-07-23 Martin Baulig <martin@ximian.com>
9652 * class.cs (PartialContainer): New public class.
9653 (ClassPart): New public class.
9654 (TypeContainer): Added support for partial classes.
9655 (TypeContainer.GetClassBases): Splitted some of the functionality
9656 out into GetNormalBases() and GetPartialBases().
9658 * cs-tokenizer.cs (Token.PARTIAL): New token.
9659 (Tokenizer.consume_identifier): Added some hacks to recognize
9660 `partial', but only if it's immediately followed by `class',
9661 `struct' or `interface'.
9663 * cs-parser.jay: Added support for partial clases.
9665 2004-07-23 Martin Baulig <martin@ximian.com>
9667 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9668 a `DeclSpace' and also made it readonly.
9669 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9670 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9671 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9673 * cs-parser.jay: Pass the `current_class', not the
9674 `current_container' (at the moment, this is still the same thing)
9675 to a new Method, Property, Event, Indexer or Constructor.
9677 2004-07-23 Martin Baulig <martin@ximian.com>
9679 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9680 and removed the `current_interface' one.
9681 (struct_declaration, class_declaration, interface_declaration):
9682 Set `current_class' to the newly created class/struct/interface;
9683 set their `Bases' and call Register() before parsing their body.
9685 2004-07-23 Martin Baulig <martin@ximian.com>
9687 * class.cs (Kind): New public enum.
9688 (TypeContainer): Made this class abstract.
9689 (TypeContainer.Kind): New public readonly field.
9690 (TypeContainer.CheckDef): New public method; moved here from
9692 (TypeContainer.Register): New public abstract method.
9693 (TypeContainer.GetPendingImplementations): New public abstract
9695 (TypeContainer.GetClassBases): Removed the `is_class' and
9696 `is_iface' parameters.
9697 (TypeContainer.DefineNestedTypes): Formerly known as
9699 (ClassOrStruct): Made this class abstract.
9701 * tree.cs (RootTypes): New public type.
9703 2004-07-20 Martin Baulig <martin@ximian.com>
9705 * tree.cs (Tree.RecordNamespace): Removed.
9706 (Tree.Namespaces): Removed.
9708 * rootcontext.cs (RootContext.IsNamespace): Removed.
9710 * cs-parser.jay (namespace_declaration): Just create a new
9711 NamespaceEntry here.
9713 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9715 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9716 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9717 entry to make sure it runs in the correct runtime version.
9719 2004-07-18 Martin Baulig <martin@ximian.com>
9721 * generic.cs (ConstructedType.CheckConstraints): Improved
9722 constraints checking.
9724 2004-07-18 Martin Baulig <martin@ximian.com>
9726 * expression.cs (Invocation.BetterMethod): Call
9727 TypeManager.TypeToCoreType() on all types and removed my previous
9728 hack; we're already doig the right thing here.
9730 2004-07-17 Martin Baulig <martin@ximian.com>
9732 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9734 2004-07-16 Martin Baulig <martin@ximian.com>
9736 * iterators.cs: Added generics support.
9738 2004-07-16 Martin Baulig <martin@ximian.com>
9740 * iterators.cs: Rewrote this. We're now using one single Proxy
9741 class for both the IEnumerable and the IEnumerator interface and
9742 `Iterator' derives from Class so we can use the high-level API.
9744 * class.cs (TypeContainer.AddIterator): New method.
9745 (TypeContainer.DoDefineType): New protected virtual method, which
9746 is called from DefineType().
9747 (TypeContainer.DoDefineMembers): Call DefineType() and
9748 DefineMembers() on all our iterators.
9749 (TypeContainer.Emit): Call Emit() on all our iterators.
9750 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9752 * codegen.cs (EmitContext.CurrentIterator): New public field.
9754 2004-07-15 Martin Baulig <martin@ximian.com>
9757 (TypeManager.not_supported_exception_type): New type.
9759 2004-07-14 Martin Baulig <martin@ximian.com>
9762 (TypeManager.generic_ienumerable_type): New type.
9763 (TypeManager.generic_ienumerator_type): New type.
9766 (RootContext.interfaces_first_stage): Added
9767 "System.Collections.Generic.IEnumerator`1" and
9768 "System.Collections.Generic.IEnumerable`1".
9770 2004-07-14 Martin Baulig <martin@ximian.com>
9772 * iterators.cs: Use real error numbers.
9774 2004-07-14 Martin Baulig <martin@ximian.com>
9776 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9777 requires this to be a System.Collection.IEnumerable and not a
9778 class implementing that interface.
9779 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9781 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9783 * class.cs: Fixed previous fix, it broke some error tests.
9785 2004-07-12 Martin Baulig <martin@ximian.com>
9787 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9790 2004-07-14 Martin Baulig <martin@ximian.com>
9792 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9793 an exclamation mark (!) for the generic arity to reflect the
9794 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9796 2004-07-13 Martin Baulig <martin@ximian.com>
9798 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9799 specifiers being part of a type argument.
9801 2004-07-13 Martin Baulig <martin@ximian.com>
9803 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9804 name for generic types.
9806 2004-07-13 Martin Baulig <martin@ximian.com>
9808 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9811 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9813 * assign.cs (LocalTemporary): Add new argument: is_address,If
9814 `is_address' is true, then the value that we store is the address
9815 to the real value, and not the value itself.
9817 * ecore.cs (PropertyExpr): use the new local temporary
9818 stuff to allow us to handle X.Y += z (where X is a struct)
9820 2004-07-08 Martin Baulig <martin@ximian.com>
9822 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9823 not always return, just like we're doing in Using.Resolve().
9825 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9827 * cs-parser.jay (fixed_statement): flag this as Pinned.
9829 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9831 * typemanager.cs (TypeManager): Removed MakePinned method, this
9832 mechanism is replaced with the .NET 2.x compatible mechanism of
9833 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9835 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9836 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9837 `IsFixed' property which has a different meaning.
9839 2004-07-02 Raja R Harinath <rharinath@novell.com>
9841 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9842 visible from inside a nested class, not just the names of the
9843 immediately enclosing class.
9846 2004-06-24 Raja R Harinath <rharinath@novell.com>
9848 * expression.cs (BetterConversion): Remove buggy special-case
9849 handling of "implicit constant expression conversions". At this
9850 point, we already know that the conversion is possible -- we're
9851 only checking to see which is better.
9853 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9855 * cs-parser.jay: Added error CS0210 test.
9857 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9859 * cs-parser.jay: Added error CS0134 test.
9861 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9864 * cs-parser.jay: Added error CS0145 test.
9866 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9868 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9870 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9872 * expression.cs (StackAlloc.Resolve): The argument may not
9873 be a constant; deal with this case.
9875 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9877 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9878 GetIndexerAttributeValue.
9879 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9881 * class.cs (Indexer.Define): Added error tests for CS0415,
9884 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9886 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9889 2004-06-23 Martin Baulig <martin@ximian.com>
9891 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9892 neither return nor throw, reset the barrier as well. Fixes #60457.
9894 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9896 * class.cs : EventAttributes is now set to None by default.
9897 This fixes bug #60459.
9899 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9902 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9903 Don't throw exception but return null (it's sufficient now).
9905 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9907 * typemanager.cs (GetArgumentTypes): Faster implementation.
9909 2004-06-18 Martin Baulig <martin@ximian.com>
9911 * attribute.cs (Attribute.Resolve): Check whether we're an
9912 EmptyCast which a Constant child. Fixes #60333.
9914 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9916 * statement.cs (EmitCollectionForeach): Account for the fact that
9917 not all valuetypes are in areas which we can take the address of.
9918 For these variables, we store to a temporary variable. Also, make
9919 sure that we dont emit a `callvirt' on a valuetype method.
9921 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9923 * expression.cs (StackAlloc.DoReSolve): Added test for
9924 negative parameter (CS0247).
9926 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9929 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9931 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9934 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9937 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9939 Fix bug #58254 & cs1555.cs, cs1556.cs
9940 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9942 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9944 * cs-parser.jay: Added error CS1669 test for indexers.
9946 2004-06-18 Martin Baulig <martin@ximian.com>
9948 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9949 argument. Fixes #60441.
9951 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9952 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9953 The name needs to have the actual name of the method in order
9954 for other tests (such as the one in OverloadResolve for Invoke
9955 on a delegate) to work. As well, it does not really help
9956 error reporting because the method group had multiple methods.
9957 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9958 Make profiling work.
9960 2004-06-13 Martin Baulig <martin@ximian.com>
9962 * cs-parser.jay: Don't allow generic attributes.
9964 2004-06-13 Martin Baulig <martin@ximian.com>
9966 * class.cs (MemberBase.DoDefineBase): New protected method.
9967 (MemberBase.DoDefine): Compute the `flags' in the new
9968 DoDefineBase() which must be called first.
9969 (Method.Define): Call DoDefineBase() first so we have the flags
9970 when defining the generic method.
9972 * cs-parser.jay (interface_method_declaration): Support generic methods.
9974 2004-06-13 Martin Baulig <martin@ximian.com>
9976 * decl.cs (TypeName): Removed.
9977 (MemberName): Removed TypeName and MemberNow; now we just have
9980 * cs-parser.jay: Don't distinguish between type arguments and type
9981 parameters in the grammar and simplified the rules a bit. The
9982 reduce/reduce conflicts are now gone (except the one we inherited
9985 2004-06-11 Martin Baulig <martin@ximian.com>
9987 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9988 call this twice: for params and varargs methods.
9990 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9993 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9995 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9997 * attribute.cs (Attribute.GetValidTargets): Made public.
10000 (AbstractPropertyEventMethod): New class for better code sharing.
10001 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10003 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10005 2004-06-09 Martin Baulig <martin@ximian.com>
10007 * cs-parser.jay: Removed a reduce/reduce conflict.
10009 2004-06-03 Martin Baulig <martin@ximian.com>
10011 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10012 GetSimpleName() and return a SimpleName.
10014 * ecore.cs (SimpleName.Arguments): New public field.
10015 (SimpleName): Added overloaded ctor which takes an additional
10016 TypeArguments argument.
10017 (SimpleName.SimpleNameResolve): Added support for generic methods.
10018 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10019 formerly in MemberAccess.DoResolve(), but we also need it in
10020 SimpleNameResolve().
10022 * expression.cs (MemberAccess.DoResolve): Use the new
10023 MethodGroupExpr.ResolveGeneric().
10025 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10027 * decl.cs: If possible, use lookuptypedirect here. We can only do
10028 this if there is no `.' after the namespace. Avoids using
10029 LookupType, which does lots of slow processing.
10030 (FindNestedType) New method, does what it says :-).
10031 * namespace.cs: use LookupTypeDirect.
10032 * rootcontext.cs: use membercache, if possible.
10033 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10035 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10038 According to the spec,
10040 In a member access of the form E.I, if E is a single identifier,
10041 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10042 field, property, localvariable, or parameter with the same type as
10043 the meaning of E as a type-name (§3.8), then both possible
10044 meanings of E are permitted.
10046 We did not check that E as a simple-name had the same type as E as
10049 This trivial check gives us 5-7% on bootstrap time.
10051 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10053 * expression.cs (Invocation.OverloadResolve): Avoid the
10054 use of hashtables and boxing here by allocating on demand.
10056 2004-05-30 Martin Baulig <martin@ximian.com>
10058 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10059 we're doing a silent lookup. Don't try to lookup nested types in
10060 TypeManager.object_type (thanks to Ben Maurer).
10062 2004-05-30 Martin Baulig <martin@ximian.com>
10064 Committing a patch from Ben Maurer.
10066 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10068 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10070 * convert.cs: add a trivial cache for overload operator resolution.
10072 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10075 (AttributeTester.GetObsoleteAttribute): Returns instance of
10076 ObsoleteAttribute when type is obsolete.
10079 (TypeContainer.VerifyObsoleteAttribute): Override.
10080 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10081 (MethodCode.VerifyObsoleteAttribute): Override.
10082 (MemberBase.VerifyObsoleteAttribute): Override.
10085 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10086 and report proper error.
10089 (Delegate.VerifyObsoleteAttribute): Override.
10092 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10093 and report proper error.
10094 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10097 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10101 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10102 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10103 Added test for ObsoleteAttribute.
10106 (Catch): Derived from Statement.
10108 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10110 * decl.cs: If possible, use lookuptypedirect here. We can only do
10111 this if there is no `.' after the namespace. Avoids using
10112 LookupType, which does lots of slow processing.
10113 (FindNestedType) New method, does what it says :-).
10114 * namespace.cs: use LookupTypeDirect.
10115 * rootcontext.cs: use membercache, if possible.
10116 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10118 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10121 According to the spec,
10123 In a member access of the form E.I, if E is a single identifier,
10124 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10125 field, property, localvariable, or parameter with the same type as
10126 the meaning of E as a type-name (§3.8), then both possible
10127 meanings of E are permitted.
10129 We did not check that E as a simple-name had the same type as E as
10132 This trivial check gives us 5-7% on bootstrap time.
10134 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10136 Fixed bug #59071 & cs0160.cs
10137 * statement.cs (Try.Resolve): Check here whether order of catch
10138 clauses matches their dependencies.
10140 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10143 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10146 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10148 * expression.cs (Invocation.OverloadResolve): Avoid the
10149 use of hashtables and boxing here by allocating on demand.
10151 2004-05-30 Martin Baulig <martin@ximian.com>
10153 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10154 we're doing a silent lookup. Don't try to lookup nested types in
10155 TypeManager.object_type (thanks to Ben Maurer).
10157 2004-05-30 Martin Baulig <martin@ximian.com>
10159 Committing a patch from Ben Maurer.
10161 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10163 2004-05-29 Martin Baulig <martin@ximian.com>
10165 * class.cs (IMethodData.ShouldIgnore): New method.
10167 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10168 `Location' argument, we don't need it anywhere. Use
10169 `IMethodData.ShouldIgnore ()' instead of
10170 `MethodData.GetMethodFlags ()'.
10171 (TypeManager.AddMethod): Removed.
10172 (TypeManager.AddMethod2): Renamed to AddMethod.
10174 2004-05-29 Martin Baulig <martin@ximian.com>
10176 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10178 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10179 converting from a class type S to an interface type and we already
10180 have an object on the stack, don't box it again. Fixes #52578.
10182 2004-05-29 Martin Baulig <martin@ximian.com>
10184 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10185 Added support for `params' parameters. Fixes #59267.
10187 2004-05-29 Martin Baulig <martin@ximian.com>
10189 * literal.cs (NullPointer): Provide a private .ctor which sets
10190 `type' to TypeManager.object_type. Fixes #59048.
10192 2004-05-29 Martin Baulig <martin@ximian.com>
10194 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10195 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10197 * ecore.cs (EventExpr.instance_expr): Make the field private.
10199 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10201 Fixed bug #50080 & cs0214-2.cs
10202 * expression.cs (Cast.DoResolve): Check unsafe context here.
10204 * statement.cs (Resolve.DoResolve): Likewise.
10206 2004-05-26 Martin Baulig <martin@ximian.com>
10208 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10210 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10211 (RootContext.LookupType): Pass down the `silent' flag.
10213 2004-05-25 Martin Baulig <martin@ximian.com>
10216 (MethodGroupExpr.IdenticalTypeName): New public property.
10217 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10218 expression actually refers to a type.
10220 2004-05-25 Martin Baulig <martin@ximian.com>
10222 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10223 for #56176 and made it actually work.
10225 2004-05-25 Martin Baulig <martin@ximian.com>
10227 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10228 (FieldExpr, PropertyExpr): Override and implement
10229 CacheTemporaries. Fixes #52279.
10231 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10233 * location.cs: In the new compiler listing a file twice is a
10234 warning, not an error.
10236 2004-05-24 Martin Baulig <martin@ximian.com>
10238 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10239 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10241 2004-05-24 Martin Baulig <martin@ximian.com>
10243 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10244 walking the `using' list. Fixes #53921.
10246 2004-05-24 Martin Baulig <martin@ximian.com>
10248 * const.cs (Const.LookupConstantValue): Added support for
10249 EmptyCast's; fixes #55251.
10251 2004-05-24 Martin Baulig <martin@ximian.com>
10253 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10254 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10255 which does the CS0135 check. The reason is that we first need to
10256 check whether the variable actually exists.
10258 2004-05-24 Martin Baulig <martin@ximian.com>
10260 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10261 than RootContext.LookupType() to find the explicit interface
10262 type. Fixes #58584.
10264 2004-05-24 Raja R Harinath <rharinath@novell.com>
10266 * Makefile: Simplify. Use executable.make.
10267 * mcs.exe.sources: New file. List of sources of mcs.exe.
10269 2004-05-24 Anders Carlsson <andersca@gnome.org>
10273 Use the invariant culture when doing String.Compare for CLS case
10276 2004-05-23 Martin Baulig <martin@ximian.com>
10278 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10279 don't have any dots. Fixes #52622, added cs0246-8.cs.
10281 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10283 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10285 * class.cs (MemberBase.Define): Reuse MemberType member for
10286 resolved type. Other methods can use it too.
10288 2004-05-23 Martin Baulig <martin@ximian.com>
10290 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10291 the variable also exists in the current block (otherwise, we need
10292 to report a CS0103). Fixes #58670.
10294 2004-05-23 Martin Baulig <martin@ximian.com>
10296 * flowanalysis.cs (Reachability.Reachable): Compute this
10297 on-the-fly rather than storing it as a field.
10299 2004-05-23 Martin Baulig <martin@ximian.com>
10301 * flowanalysis.cs (Reachability.And): Manually compute the
10302 resulting `barrier' from the reachability.
10304 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10307 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10308 instance of ObsoleteAttribute when symbol is obsolete.
10311 (IMethodData): Extended interface for ObsoleteAttribute support.
10313 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10315 * attribute.cs: Fix bug #55970
10317 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10321 (GetObsoleteAttribute): New method. Creates the instance of
10323 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10324 ObsoleteAttribute when member is obsolete.
10325 (AttributeTester.Report_ObsoleteMessage): Common method for
10326 Obsolete error/warning reporting.
10329 (TypeContainer.base_classs_type): New member for storing parent type.
10332 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10333 for this MemberCore.
10335 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10337 * attribute.cs, const.cs: Fix bug #58590
10339 2004-05-21 Martin Baulig <martin@ximian.com>
10341 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10342 out parameters if the end of the method is unreachable. Fixes
10345 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10347 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10348 Hari was right, why extra method.
10350 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10352 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10354 2004-05-20 Martin Baulig <martin@ximian.com>
10356 * delegate.cs: Convert this file to Unix mode - like the original
10359 2004-05-20 Martin Baulig <martin@ximian.com>
10361 * attribute.cs: Convert this file to Unix mode - like the original
10364 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10366 Fix bug #58688 (MCS does not report error when the same attribute
10369 * attribute.cs (Attribute.Emit): Distinction between null and default.
10371 2004-05-19 Raja R Harinath <rharinath@novell.com>
10373 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10374 of a top-level attribute without an attribute target.
10375 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10377 (Attribute.Conditional_GetConditionName),
10378 (Attribute.Obsolete_GetObsoleteMessage): Update.
10379 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10380 part of ScanForIndexerName.
10381 (Attribute.CanIgnoreInvalidAttribute): New function.
10382 (Attribute.ScanForIndexerName): Move to ...
10383 (Attributes.ScanForIndexerName): ... here.
10384 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10385 (Attributes.Search): New internal variant that can choose not to
10386 complain if types aren't resolved. The original signature now
10388 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10389 complaints suppressed.
10390 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10391 only if it not useful.
10392 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10393 top-level for attributes that are shared between the assembly
10394 and a top-level class.
10395 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10396 * class.cs: Update to reflect changes.
10397 (DefineIndexers): Fuse loops.
10398 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10399 a couple more variants of attribute names.
10401 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10403 Fix bug #52585 (Implemented explicit attribute declaration)
10406 (Attributable.ValidAttributeTargets): New abstract method. It gets
10407 list of valid attribute targets for explicit target declaration.
10408 (Attribute.Target): It holds target itself.
10409 (AttributeSection): Removed.
10410 (Attribute.CheckTargets): New method. It checks whether attribute
10411 target is valid for the current element.
10414 (EventProperty): New class. For events that are declared like
10415 property (with add and remove accessors).
10416 (EventField): New class. For events that are declared like field.
10419 * cs-parser.jay: Implemented explicit attribute target declaration.
10421 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10422 Override ValidAttributeTargets.
10425 (ReturnParameter): Class for applying custom attributes on
10427 (ParameterAtribute): New class. Class for applying custom
10428 attributes on the parameter type.
10430 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10432 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10435 (Method): Allow UNSAFE here.
10437 * modifiers.cs: Support unsafe reporting.
10439 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10441 * decl.cs: Fix bug #58478.
10443 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10445 * statement.cs: When checking for unreachable code on an EmptyStatement,
10446 set the location. Fixes bug #58488.
10448 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10450 * driver.cs: Add -pkg handling.
10452 From Gonzalo: UseShelLExecute=false
10454 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10457 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10459 (Attribute.IsClsCompliaceRequired): Moved to base for better
10461 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10462 when attribute is AttributeUsageAttribute.
10463 (Attribute.GetValidTargets): Simplified.
10464 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10465 attribute for this type.
10466 (Attribute.ApplyAttributes): Method renamed to Emit and make
10468 (GlobalAttributeSection): New class for special handling of global
10469 attributes (assembly, module).
10470 (AttributeSection.Emit): New method.
10472 * class.cs: Implemented Attributable abstract methods.
10473 (MethodCore.LabelParameters): Moved to Parameter class.
10474 (Accessor): Is back simple class.
10475 (PropertyMethod): Implemented Attributable abstract class.
10476 (DelegateMethod): Implemented Attributable abstract class.
10477 (Event): New constructor for disctintion between normal Event
10478 and Event with accessors.
10480 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10482 * codegen.cs, const.cs, decl.cs, delegate.cs:
10483 (CommonAssemblyModulClass): Implemented Attributable abstract class
10486 * enum.cs: Implement IAttributeSupport interface.
10487 (EnumMember): New class for emum members. Implemented Attributable
10491 (ParameterBase): Is abstract.
10492 (ReturnParameter): New class for easier [return:] attribute handling.
10494 * typemanager.cs: Removed builder_to_attr.
10496 2004-05-11 Raja R Harinath <rharinath@novell.com>
10499 * attribute.cs (Attribute.GetPositionalValue): New function.
10500 * class.cs (TypeContainer.VerifyMembers): New function.
10501 (TypeContainer.Emit): Use it.
10502 (ClassOrStruct): New base class for Class and Struct.
10503 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10504 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10506 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10507 then each non-static field should have a FieldOffset attribute.
10508 Otherwise, none of the fields should have a FieldOffset attribute.
10509 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10510 and FieldOffset attributes.
10511 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10512 (TypeManager.field_offset_attribute_type): New core types.
10513 (TypeManager.InitCoreTypes): Initialize them.
10515 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10517 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10518 Return correct type.
10521 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10523 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10524 be implicitly converted to ulong.
10526 * expression.cs: The logic for allowing operator &, | and ^ worked
10527 was wrong, it worked before because we did not report an error in
10528 an else branch. Fixes 57895.
10530 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10531 allow volatile fields to be reference types.
10533 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10535 * driver.cs: Add support for /debug-
10537 2004-05-07 Raja R Harinath <rharinath@novell.com>
10539 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10540 Add a 'complain' parameter to silence errors.
10541 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10542 silently overlooked type-resolutions.
10543 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10544 to reflect changes.
10545 (Attributes.Search): New function.
10546 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10547 (Attributes.GetAttributeFullName): Remove hack.
10548 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10549 Update to reflect changes.
10550 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10551 Use Attributes.Search instead of nested loops.
10553 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10556 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10557 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10558 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10560 * report.cs: (Report.Warning): Renamed to Warning_T because of
10561 parameter collision.
10563 2004-05-05 Raja R Harinath <rharinath@novell.com>
10565 * expression.cs (MemberAccess.ResolveMemberAccess):
10566 Exit with non-zero status after Report.Error.
10567 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10569 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10571 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10573 * support.cs: Don't hang when the file is empty.
10575 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10577 * support.cs: In SeekableStreamReader, compute the preamble size of the
10578 underlying stream. Position changes should take into account that initial
10581 2004-05-03 Todd Berman <tberman@sevenl.net>
10583 * driver.cs: remove unused GetSysVersion function.
10585 2004-05-03 Todd Berman <tberman@sevenl.net>
10587 * driver.cs: Remove the hack from saturday, as well as the hack
10588 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10589 link_paths to get that bit proper.
10591 2004-05-01 Todd Berman <tberman@sevenl.net>
10593 * driver.cs: Try a LoadFrom before a Load, this checks the current
10594 path. This is currently a bug in mono that is be fixed, however, this
10595 provides a workaround for now. This will be removed when the bug
10598 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10600 * CryptoConvert.cs: Updated to latest version. Fix issue with
10601 incomplete key pairs (#57941).
10603 2004-05-01 Todd Berman <tberman@sevenl.net>
10605 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10608 2004-04-30 Jackson Harper <jackson@ximian.com>
10610 * codegen.cs: Open keys readonly.
10612 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10614 * typemanager.cs: don't report cyclic struct layout when a struct
10615 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10616 which has 2 Pango.Rectangle fields.
10618 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10620 * expression.cs: Handle IntPtr comparisons with IL code
10621 rather than a method call.
10623 2004-04-29 Martin Baulig <martin@ximian.com>
10625 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10626 the list of PropertyInfo's in class hierarchy and find the
10627 accessor. Fixes #56013.
10629 2004-04-29 Martin Baulig <martin@ximian.com>
10631 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10633 2004-04-29 Martin Baulig <martin@ximian.com>
10635 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10637 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10639 2004-04-29 Martin Baulig <martin@ximian.com>
10641 * class.cs (ConstructorInitializer.Resolve): Check whether the
10642 parent .ctor is accessible. Fixes #52146.
10644 2004-04-29 Martin Baulig <martin@ximian.com>
10646 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10648 * statement.cs (Using.EmitLocalVariableDecls): Use
10649 TypeManager.idisposable_type, not typeof (IDisposable).
10650 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10652 2004-04-29 Martin Baulig <martin@ximian.com>
10654 * class.cs (Event.Define): Don't emit the field and don't set
10655 RTSpecialName and SpecialName for events on interfaces. Fixes
10658 2004-04-29 Raja R Harinath <rharinath@novell.com>
10660 Refactor Attribute.ApplyAttributes.
10661 * attribute.cs (Attributable): New base class for objects that can
10662 have Attributes applied on them.
10663 (Attribute): Make AttributeUsage fields public.
10664 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10665 (Attribute.IsInternalCall): New property.
10666 (Attribute.UsageAttr): Convert to a public read-only property.
10667 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10668 (Attribute.ResolveType, Attribute.Resolve)
10669 (Attribute.ScanForIndexerName): Update to reflect changes.
10670 (Attribute.CheckAttributeTarget): Re-format.
10671 (Attribute.ApplyAttributes): Refactor, to various
10672 Attributable.ApplyAttributeBuilder methods.
10673 * decl.cs (MemberCore): Make Attributable.
10674 * class.cs (Accessor): Make Attributable.
10675 (MethodData.ApplyAttributes): Use proper attribute types, not
10677 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10678 (TypeContainer.ApplyAttributeBuilder)
10679 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10680 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10681 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10682 (Operator.ApplyAttributeBuilder): New factored-out methods.
10683 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10684 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10685 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10686 * parameter.cs (ParameterBase): New Attributable base class
10687 that can also represent Return types.
10688 (Parameter): Update to the changes.
10690 2004-04-29 Jackson Harper <jackson@ximian.com>
10692 * driver.cs: Prefer the corlib system version when looking for
10693 assemblies in the GAC. This is still a hack, but its a better hack
10696 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10698 * decl.cs, enum.cs: Improved error 3005 reporting.
10700 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10701 (related_symbols): New private member for list of symbols
10702 related to reported error/warning.
10704 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10706 2004-04-29 Martin Baulig <martin@ximian.com>
10708 * ecore.cs (Expression.Constantify): If we're an enum and
10709 TypeManager.TypeToCoreType() doesn't give us another type, use
10710 t.UnderlyingSystemType. Fixes #56178.
10712 2004-04-29 Martin Baulig <martin@ximian.com>
10714 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10715 interfaces and for each interface, only add members directly
10716 declared in that interface. Fixes #53255.
10718 2004-04-28 Martin Baulig <martin@ximian.com>
10720 * expression.cs (ConditionalLogicalOperator): Use a temporary
10721 variable for `left' to avoid that we evaluate it more than once;
10724 2004-04-28 Martin Baulig <martin@ximian.com>
10726 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10729 2004-04-28 Martin Baulig <martin@ximian.com>
10731 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10734 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10735 whether the type is not void (CS1547).
10737 2004-04-28 Martin Baulig <martin@ximian.com>
10739 * expression.cs (Unary.DoResolveLValue): Override this and report
10740 CS0131 for anything but Operator.Indirection.
10742 2004-04-28 Martin Baulig <martin@ximian.com>
10744 Committing a patch from Ben Maurer; see bug #50820.
10746 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10749 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10752 2004-04-28 Martin Baulig <martin@ximian.com>
10754 Committing a patch from Ben Maurer; see bug #50820.
10756 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10759 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10762 2004-04-28 Martin Baulig <martin@ximian.com>
10764 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10765 (Block.AddLabel): Call DoLookupLabel() to only search in the
10768 2004-04-28 Martin Baulig <martin@ximian.com>
10770 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10771 comparing StringConstants and NullLiterals in Equality and Inequality.
10773 2004-04-28 Jackson Harper <jackson@ximian.com>
10775 * driver.cs: Attempt to load referenced assemblies from the
10776 GAC. This is the quick and dirty version of this method that
10777 doesnt take into account versions and just takes the first
10778 canidate found. Will be good enough for now as we will not have more
10779 then one version installed into the GAC until I update this method.
10781 2004-04-28 Martin Baulig <martin@ximian.com>
10783 * typemanager.cs (TypeManager.CheckStructCycles): New public
10784 static method to check for cycles in the struct layout.
10786 * rootcontext.cs (RootContext.PopulateTypes): Call
10787 TypeManager.CheckStructCycles() for each TypeContainer.
10788 [Note: We only need to visit each type once.]
10790 2004-04-28 Martin Baulig <martin@ximian.com>
10792 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10794 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10795 success and added `out object value'. Use a `bool resolved' field
10796 to check whether we've already been called rather than
10797 `ConstantValue != null' since this breaks for NullLiterals.
10799 2004-04-28 Raja R Harinath <rharinath@novell.com>
10801 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10802 setting of this flag, since the 'set' method may be non-public.
10804 2004-04-28 Raja R Harinath <rharinath@novell.com>
10806 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10807 check on current_vector.Block.
10809 2004-04-27 Martin Baulig <martin@ximian.com>
10811 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10812 a field initializer. Fixes #56459.
10814 2004-04-27 Martin Baulig <martin@ximian.com>
10816 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10817 we're not attempting to use an indexer. Fixes #52154.
10819 2004-04-27 Martin Baulig <martin@ximian.com>
10821 * statement.cs (Return): Don't create a return label if we don't
10822 need it; reverts my change from January 20th. Thanks to Ben
10825 2004-04-27 Martin Baulig <martin@ximian.com>
10827 According to the spec, `goto' can only leave a nested scope, but
10830 * statement.cs (Block.LookupLabel): Only lookup in the current
10831 block, don't recurse into parent or child blocks.
10832 (Block.AddLabel): Check in parent and child blocks, report
10833 CS0140/CS0158 if we find a duplicate.
10834 (Block): Removed this indexer for label lookups.
10835 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10836 this already does the error reporting for us.
10839 (FlowBranching.UsageVector.Block): New public variable; may be null.
10840 (FlowBranching.CreateSibling): Added `Block' argument.
10841 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10842 label for the target of a `goto' and check whether we're not
10843 leaving a `finally'.
10845 2004-04-27 Martin Baulig <martin@ximian.com>
10847 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10848 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10851 2004-04-27 Martin Baulig <martin@ximian.com>
10853 * statement.cs (Block.AddLabel): Also check for implicit blocks
10854 and added a CS0158 check.
10856 2004-04-27 Martin Baulig <martin@ximian.com>
10858 * flowanalysis.cs (FlowBranchingLoop): New class.
10859 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10860 UsageVector's instead of an ArrayList.
10861 (FlowBranching.Label): Likewise.
10862 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10863 (FlowBranching.AddBreakVector): New method.
10865 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10867 * attribute.cs: Small regression fix: only convert the type if we
10868 the type is different, fixes System.Drawing build.
10870 2004-04-27 Martin Baulig <martin@ximian.com>
10872 * attribute.cs (Attribute.Resolve): If we have a constant value
10873 for a named field or property, implicity convert it to the correct
10876 2004-04-27 Raja R Harinath <rharinath@novell.com>
10878 * statement.cs (Block.Block): Implicit blocks share
10879 'child_variable_names' fields with parent blocks.
10880 (Block.AddChildVariableNames): Remove.
10881 (Block.AddVariable): Mark variable as "used by a child block" in
10882 every surrounding block.
10883 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10884 been used in a child block, complain about violation of "Invariant
10885 meaning in blocks" rule.
10886 * cs-parser.jay (declare_local_variables): Don't use
10887 AddChildVariableNames.
10888 (foreach_statement): Don't create an implicit block: 'foreach'
10889 introduces a scope.
10891 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10893 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10894 converting from 0L to ulong. Fixes 57522.
10896 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10898 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10899 derived class hides via 'new' keyword field from base class (test-242.cs).
10900 TODO: Handle this in the more general way.
10902 * class.cs (CheckBase): Ditto.
10904 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10906 * decl.cs (caching_flags): New member for storing cached values
10908 (MemberCore.Flags): New enum where bit flags for caching_flags
10910 (MemberCore.cls_compliance): Moved to caching_flags.
10911 (DeclSpace.Created): Moved to caching_flags.
10913 * class.cs: Use caching_flags instead of DeclSpace.Created
10915 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10917 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10918 if we are only a derived class, not a nested class.
10920 * typemanager.cs: Same as above, but do this at the MemberLookup
10921 level (used by field and methods, properties are handled in
10922 PropertyExpr). Allow for the qualified access if we are a nested
10925 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10927 * class.cs: Refactoring.
10928 (IMethodData): New inteface; Holds links to parent members
10929 to avoid member duplication (reduced memory allocation).
10930 (Method): Implemented IMethodData interface.
10931 (PropertyBase): New inner classes for get/set methods.
10932 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10933 (Event): New inner classes for add/remove methods.
10934 (Event.DelegateMethod): Implemented IMethodData interface.
10936 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10937 EmitContext (related to class.cs refactoring).
10939 2004-04-21 Raja R Harinath <rharinath@novell.com>
10941 * delegate.cs (Delegate.VerifyApplicability): If the number of
10942 arguments are the same as the number of parameters, first try to
10943 verify applicability ignoring any 'params' modifier on the last
10947 2004-04-08 Martin Baulig <martin@ximian.com>
10949 Merged latest changes into gmcs. Please keep this comment in
10950 here, it makes it easier for me to see what changed in MCS since
10951 the last time I merged.
10953 2004-04-16 Raja R Harinath <rharinath@novell.com>
10955 * class.cs (TypeContainer.AddIndexer): Use
10956 'ExplicitInterfaceName' to determine if interface name was
10957 explicitly specified. 'InterfaceType' is not initialized at this time.
10958 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10959 Indexers array is already in the required order. Initialize
10960 'IndexerName' only if there are normal indexers.
10961 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10962 (TypeContainer.Emit): Emit DefaultMember attribute only if
10963 IndexerName is initialized.
10966 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10968 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10971 2004-04-15 Raja R Harinath <rharinath@novell.com>
10973 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10977 * attribute.cs (Attribute.Resolve): Check for duplicate named
10981 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10983 * iterators.cs (MarkYield): track whether we are in an exception,
10984 and generate code accordingly. Use a temporary value to store the
10985 result for our state.
10987 I had ignored a bit the interaction of try/catch with iterators
10988 since their behavior was not entirely obvious, but now it is
10989 possible to verify that our behavior is the same as MS .NET 2.0
10993 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10995 * iterators.cs: Avoid creating temporaries if there is no work to
10998 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10999 Enumerations, use TypeManager.EnumToUnderlying and call
11002 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11005 (This.Emit): Use EmitContext.EmitThis to emit our
11008 (This.EmitAssign): Ditto.
11010 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11011 codepaths, we will move all the functionality into
11014 (FieldExpr.EmitAssign): Ditto.
11016 This fixes several hidden bugs that I uncovered while doing a code
11017 review of this today.
11019 * codegen.cs (EmitThis): reworked so the semantics are more clear
11020 and also support value types "this" instances.
11022 * iterators.cs: Changed so that for iterators in value types, we
11023 do not pass the value type as a parameter.
11025 Initialization of the enumerator helpers is now done in the caller
11026 instead of passing the parameters to the constructors and having
11027 the constructor set the fields.
11029 The fields have now `assembly' visibility instead of private.
11031 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11033 * expression.cs (Argument.Resolve): Check if fields passed as ref
11034 or out are contained in a MarshalByRefObject.
11036 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11037 another compiler type.
11039 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11041 * class.cs (Indexer.Define): use the new name checking method.
11042 Also, return false on an error.
11043 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11044 (is_identifier_[start/part]_character): make static.
11046 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11048 * expression.cs (Binary.ResolveOperator): Do no append strings
11049 twice: since we can be invoked more than once (array evaluation)
11050 on the same concatenation, take care of this here. Based on a fix
11051 from Ben (bug #56454)
11053 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11055 * codegen.cs: Fix another case where CS1548 must be reported (when
11056 delay-sign isn't specified and no private is available #56564). Fix
11057 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11058 error when MCS is used on the MS runtime and we need to delay-sign
11059 (which seems unsupported by AssemblyBuilder - see #56621).
11061 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11063 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11064 (TypeManager.ComputeNamespaces): Faster implementation for
11067 * compiler.csproj: Updated AssemblyName to mcs.
11069 2004-05-11 Jackson Harper <jackson@ximian.com>
11071 * Makefile: Preserve MONO_PATH
11073 2004-05-11 Jackson Harper <jackson@ximian.com>
11075 * Makefile: Use mono and mcs to build gmcs
11077 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11079 * codegen.cs: Add patch from Robert Shade
11080 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11083 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11085 * CryptoConvert.cs: Updated to latest version. Fix issue with
11086 incomplete key pairs (#57941).
11088 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11090 * codegen.cs: Fix another case where CS1548 must be reported (when
11091 delay-sign isn't specified and no private is available #56564). Fix
11092 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11093 error when MCS is used on the MS runtime and we need to delay-sign
11094 (which seems unsupported by AssemblyBuilder - see #56621).
11096 2004-04-29 Jackson Harper <jackson@ximian.com>
11098 * Makefile: Set MONO_PATH to use the bootstrap corlib
11099 * driver.cs: Check the GAC for referenced assemblies.
11101 2004-04-29 Martin Baulig <martin@ximian.com>
11103 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11105 2004-04-07 Martin Baulig <martin@ximian.com>
11107 * expression.cs (Binary.ResolveOperator): Added special case for
11108 Equality/Inequality between a type parameter and a null literal.
11110 2004-04-07 Martin Baulig <martin@ximian.com>
11112 * convert.cs: Check null literal -> type parameter conversions.
11114 2004-04-07 Martin Baulig <martin@ximian.com>
11116 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11117 `class' and `struct' constraints.
11119 2004-04-07 Martin Baulig <martin@ximian.com>
11121 * generic.cs (SpecialConstraint): New public enum.
11122 (Constraints.Resolve): Added support for the `class' and `struct'
11125 * cs-parser.jay (type_parameter_constraint): Added support for the
11126 `class' and `struct' constraints.
11128 2004-04-07 Martin Baulig <martin@ximian.com>
11130 * support.cs (GenericConstraints): Replaced `Types' by
11131 `ClassConstraint' and `InterfaceConstraints'; added
11132 `HasClassConstraint'.
11134 2004-04-07 Martin Baulig <martin@ximian.com>
11137 (Constraints.InterfaceConstraints): New public property.
11138 (Constraints.Types): Make this property public
11139 (TypeParameter): Implement IMemberContainer.
11140 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11141 instead of a TypeBuilder/MethodBuilder; pass the interface
11142 constraints to TypeManager.AddTypeParameter().
11143 (TypeParameter.DefineType): Just take an EmitContext and no
11144 TypeBuilder/MethodBuilder. Use the new public API.
11146 * typemanager.cs (TypeManager.AddTypeParameter): Added
11147 `TypeExpr[]' argument; add the interfaces to the
11148 `builder_to_ifaces' hash.
11149 (TypeManager.LookupMemberContainer): For
11150 GenericTypeParameterBuilders, get the TypeParameter from the
11151 `builder_to_type_param'.
11152 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11153 the TypeParameter and call FindMembers on it.
11155 2004-04-07 Martin Baulig <martin@ximian.com>
11158 (MethodCore.GenericMethod): Moved this field here from Method.
11159 (MethodCore.IsDuplicateImplementation): Take the number of type
11160 parameters into account if we're a generic method.
11162 * expression.cs (Invocation.InferTypeArguments): Don't return true
11163 if `arguments' is null; we still need to check whether we actually
11164 don't need to infer anything in this case.
11165 (MemberAccess): Merged the functionality from GenericMemberAccess
11168 * generic.cs (GenericMemberAccess): Removed.
11170 2004-04-05 Martin Baulig <martin@ximian.com>
11172 * decl.cs (MemberCore): For generic classes, interfaces and
11173 structs, `Name' now includes the number of type parameters
11174 ("Stack!1.Node!1").
11175 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11176 encode the number of type arguments in the type name.
11178 * expression.cs (Expression.MemberLookup): Removed the
11179 `num_type_args' argument; we now encode the number of type
11180 arguments in the type name.
11182 * ecore.cs (SimpleName): Encode the number of type arguments in
11183 the type name itself.
11185 * generic.cs (ConstructedType): Likewise.
11187 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11188 `MemberName'; we now include the number of type parameters in the
11191 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11192 (TypeManager.MemberLookup): Removed the
11193 `num_type_args' argument; we now encode the number of type
11194 arguments in the type name.
11196 2004-04-03 Martin Baulig <martin@ximian.com>
11198 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11199 (MemberCore.MemberName): Moved here from MemberBase.
11200 (DeclSpace.SetParameterInfo): Just take the constraints as an
11201 ArrayList; we already have the type parameters in our
11202 `MemberName'; also do the CS0080 reporting here.
11204 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11205 `IDENTIFIER opt_type_parameter_list'; when constructing our
11206 `MemberName', it'll already include our type parameters.
11207 (class_declaration, interface_declaration): Likewise.
11208 (delegate_declaration): Likewise.
11209 (MakeName): Take a MemberName and return a MemberName.
11210 The following two changes are required to avoid shift/reduce conflicts:
11211 (member_name): Don't include a TypeName anymore; ie. this is now
11212 just 'IDENTIFIER opt_type_parameter_list'.
11213 (property_declaration, event_declaration): Use a
11214 `namespace_or_type_name' instead of a `member_name'.
11216 2004-04-03 Martin Baulig <martin@ximian.com>
11218 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11219 `MemberName' class.
11220 (TypeName): Formerly known as MemberName.
11222 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11223 instead of a `MemberName'.
11225 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11226 (member_name): New rule; create a MemberName.
11228 2004-04-02 Martin Baulig <martin@ximian.com>
11230 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11231 (CS0305 and CS0308).
11233 2004-04-02 Martin Baulig <martin@ximian.com>
11235 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11236 support for nested types.
11238 2004-04-02 Martin Baulig <martin@ximian.com>
11240 * ecore.cs (IAlias): New public interface.
11241 (TypeExpr, TypeExpression): Implement IAlias.
11242 (TypeAliasExpression): New public class.
11244 * namespace.cs (Namespace): Implement IAlias.
11245 (Namespace.Lookup): Return an IAlias instead on an object.
11246 (Namespace.DefineName): Take an IAlias instead of an object.
11247 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11249 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11251 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11253 (NamespaceEntry.Lookup): Likewise.
11255 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11258 * decl.cs (DeclSpace): Implement IAlias.
11259 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11261 * generic.cs (ConstructedType): Improved error checking.
11263 2004-04-02 Martin Baulig <martin@ximian.com>
11265 * convert.cs: Added type parameter conversions.
11268 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11269 (ClassCast.Emit): If the source type is a type parameter, box it.
11270 If the target type is a type parameter, emit an `unbox.any'
11271 instead of a `classcast'.1
11273 2004-04-01 Martin Baulig <martin@ximian.com>
11275 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11277 2004-04-01 Martin Baulig <martin@ximian.com>
11279 * generic.cs (ConstructedType.CheckConstraints): Use
11280 Convert.ImplicitStandardConversionExists(); user-defined implicit
11281 conversions are not allowed according to the spec.
11283 2004-03-30 Martin Baulig <martin@ximian.com>
11285 * expression.cs (New): Added support for type parameters.
11288 (TypeManager.activator_type): New public static field.
11289 (TypeManager.activator_create_instance): Likewise.
11291 2004-03-30 Martin Baulig <martin@ximian.com>
11293 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11296 2004-03-30 Martin Baulig <martin@ximian.com>
11298 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11299 the spec here: the argument type must be convertible to the
11302 2004-03-30 Martin Baulig <martin@ximian.com>
11305 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11306 TypeManager.AddTypeParameter().
11307 (ConstructedType.CheckConstraints): Re-enable this and actually
11308 check whether we have a constructor constraint.
11311 (TypeManager.builder_to_type_param): New static field.
11312 (TypeManager.AddTypeParameter): New static method.
11313 (TypeManager.LookupTypeParameter): New public method.
11315 2004-03-30 Martin Baulig <martin@ximian.com>
11317 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11318 the new API to actually define the constructor constraint.
11321 (TypeManager.new_constraint_attr_type): New static field.
11322 (TypeManager.InitCoreTypes): Initialize it.
11324 2004-03-30 Martin Baulig <martin@ximian.com>
11326 * generic.cs (Constraints): Completed error checking, use correct
11329 2004-03-29 Martin Baulig <martin@ximian.com>
11331 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11333 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11334 public version which takes a `ParameterData pd' instead of an
11337 2004-03-29 Martin Baulig <martin@ximian.com>
11339 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11342 2004-03-29 Martin Baulig <martin@ximian.com>
11344 * expression.cs (Argument.ResolveMethodGroup): If we're a
11345 ConstructedType, call GetMemberAccess() on it.
11347 2004-03-29 Martin Baulig <martin@ximian.com>
11349 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11350 (MethodCore.CheckGenericOverride): When overriding a generic
11351 method, check whether the constraints match.
11353 * support.cs (GenericConstraints): New public interface.
11354 (ParameterData.GenericConstraints): New public method.
11356 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11357 method parameter and compute our constraints if appropriate.
11358 (Parameter.GenericConstraints): New public property.
11360 * generic.cs (Constraints): Implement GenericConstraints.
11362 2004-03-29 Martin Baulig <martin@ximian.com>
11364 * decl.cs (MemberCache.FindMemberToOverride): Use
11365 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11367 2004-03-29 Martin Baulig <martin@ximian.com>
11369 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11371 2004-03-29 Martin Baulig <martin@ximian.com>
11373 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11374 not allowed on non-generic declarations").
11376 2004-03-29 Martin Baulig <martin@ximian.com>
11378 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11379 public version of this method.
11381 * class.cs (MethodCore.IsDuplicateImplementation): Use
11382 Invocation.InferTypeArguments() to check this.
11384 2004-03-29 Martin Baulig <martin@ximian.com>
11386 * convert.cs: Use TypeManager.IsDelegateType() instead of
11387 comparing types correctly.
11389 2004-03-29 Martin Baulig <martin@ximian.com>
11391 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11392 types directly to make it work for generic instances.
11394 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11396 2004-03-29 Martin Baulig <martin@ximian.com>
11398 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11399 support for arrays.
11401 2004-03-24 Martin Baulig <martin@ximian.com>
11403 * decl.cs (DeclSpace.FindType): Also use
11404 TypeManager.CheckGeneric() for types from the using clauses.
11406 2004-03-23 Martin Baulig <martin@ximian.com>
11408 * expression.cs (Invocation.OverloadResolve): Added `bool
11409 may_fail' argument and use it instead of the Location.IsNull() hack.
11411 2004-03-23 Martin Baulig <martin@ximian.com>
11413 * expression.cs (Invocation.InferType): Use correct type inference
11416 2004-03-23 Martin Baulig <martin@ximian.com>
11418 * ecore.cs (MethodGroupExpr.Name): Use
11419 TypeManager.CSharpSignature() instead of just the name.
11421 * expression.cs (Invocation.OverloadResolve): Provide better error
11423 (Invocation.DoResolve): OverloadResolve() never returns null
11424 without reporting an error, so removed the error -6 reporting here.
11426 2004-03-23 Martin Baulig <martin@ximian.com>
11428 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11431 * cs-parser.jay (delegate_declaration): Support generic delegates.
11433 * delegate.cs: Support generic delegates.
11435 2004-03-22 Martin Baulig <martin@ximian.com>
11437 * expression.cs (Invocation.InferParamsTypeArguments): New static
11438 method; does type inference for params arguments.
11440 2004-03-21 Martin Baulig <martin@ximian.com>
11442 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11443 method; checks whether a method is a generic method.
11445 * expression.cs (Invocation.InferTypeArguments): New static method;
11446 infer type arguments for generic method invocation.
11448 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11449 property; we set this to true if we're resolving a generic method
11450 invocation and the user specified type arguments, ie. we're not
11451 doing type inference.
11453 2004-03-20 Martin Baulig <martin@ximian.com>
11455 * class.cs (MethodData.DeclaringType): New public property.
11456 (MethodData.Define): Set DeclaringType here.
11457 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11458 instead of OperatorMethodBuilder.DeclaringType.
11460 2004-03-20 Martin Baulig <martin@ximian.com>
11462 * cs-tokenizer.cs (xtoken): Return a special
11463 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11465 * cs-parser.jay (default_value_expression): Switch to the new
11468 2004-03-19 Martin Baulig <martin@ximian.com>
11470 * decl.cs (MemberName): New class. We use this to "construct"
11471 namespace_or_type_name's.
11473 * generics.cs (TypeArguments.GetDeclarations): New public method;
11474 returns the type arguments as a string[] and reports a CS0081 if
11475 one of them is not an identifier.
11477 * class.cs (MemberBase): The .ctor now takes the name as a
11478 MemberName instead of a string.
11479 (MemberBase.ExplicitInterfaceName): Changed type from string to
11481 (MemberBase.DoDefine): If we're an explicit implementation, the
11482 InterfaceType may be a generic instance.
11484 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11485 (namespace_name): Call MemberName.GetName () to transform the
11486 MemberName into a string and ensure we don't have any type
11488 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11489 MemberName into an expression.
11490 (method_header): Use namespace_or_type_name instead of member_name.
11492 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11494 * rootcontext.cs: Add new types to the boot resolution.
11496 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11497 MulticastDelegate is not allowed.
11499 * typemanager.cs: Add new types to lookup: System.TypedReference
11502 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11503 check for TypedReference or ArgIterator, they are not allowed.
11505 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11506 makes us properly catch 1510 in some conditions (see bug 56016 for
11509 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11511 * CryptoConvert.cs: update from corlib version
11514 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11516 * class.cs (Indexer.Define): Check indexername declaration
11518 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11520 * attribute.cs (IsClsCompliant): Fixed problem with handling
11521 all three states (compliant, not-compliant, undetected).
11523 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11525 * attribute.cs (Attribute): Location is now public.
11526 (Resolve): Store resolved arguments (pos_values) in attribute class.
11527 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11528 (GetClsCompliantAttributeValue): New method that gets
11529 CLSCompliantAttribute value.
11530 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11531 if exists else null.
11532 (AttributeTester): New class for CLS-Compliant verification routines.
11534 * class.cs (Emit): Add CLS-Compliant verification.
11535 (Method.GetSignatureForError): Implemented.
11536 (Constructor.GetSignatureForError): Implemented
11537 (Constructor.HasCompliantArgs): Returns if constructor has
11538 CLS-Compliant arguments.
11539 (Constructor.Emit): Override.
11540 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11541 is needed to test only parameters.
11542 (FieldBase.GetSignatureForError): Implemented.
11543 (TypeContainer): New member for storing base interfaces.
11544 (TypeContainer.FindMembers): Search in base interfaces too.
11546 * codegen.cs (GetClsComplianceAttribute): New method that gets
11547 assembly or module CLSCompliantAttribute value.
11548 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11550 (ModuleClass.Emit): Add error 3012 test.
11552 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11554 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11555 state for all decl types.
11556 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11557 if CLS-Compliant tests are required.
11558 (IsClsCompliaceRequired): New method. Analyze whether code
11559 must be CLS-Compliant.
11560 (IsExposedFromAssembly): New method. Returns true when MemberCore
11561 is exposed from assembly.
11562 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11563 value or gets cached value.
11564 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11565 is explicitly marked with CLSCompliantAttribute.
11566 (IsIdentifierClsCompliant): New abstract method. This method is
11567 used to testing error 3005.
11568 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11569 for identifier and parameters CLS-Compliant testing.
11570 (VerifyClsCompliance): New method. The main virtual method for
11571 CLS-Compliant verifications.
11572 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11573 null. I don't know why is null (too many public members !).
11574 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11575 and get value of first CLSCompliantAttribute that found.
11577 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11578 (VerifyClsCompliance): Override and add extra tests.
11580 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11581 clscheck- disable CLS-Compliant verification event if assembly is has
11582 CLSCompliantAttribute(true).
11584 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11585 ApllyAttribute is now called in emit section as in the other cases.
11586 Possible future Emit integration.
11587 (IsIdentifierClsCompliant): New override.
11588 (VerifyClsCompliance): New override.
11589 (GetEnumeratorName): Returns full enum name.
11591 * parameter.cs (GetSignatureForError): Implemented.
11593 * report.cs (WarningData): New struct for Warning message information.
11594 (LocationOfPreviousError): New method.
11595 (Warning): New method. Reports warning based on the warning table.
11596 (Error_T): New method. Reports error based on the error table.
11598 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11599 verifications are done here.
11601 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11603 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11604 CLSCompliantAttribute.
11605 (all_imported_types): New member holds all imported types from other
11607 (LoadAllImportedTypes): New method fills static table with exported types
11608 from all referenced assemblies.
11609 (Modules): New property returns all assembly modules.
11611 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11613 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11614 throwing a parser error.
11616 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11617 which removes the hardcoded get_/set_ prefixes for properties, as
11618 IL allows for the properties to be named something else.
11622 * expression.cs: Do not override operand before we know if it is
11623 non-null. Fix 56207
11625 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11627 * typemanager.cs: support for pinned variables.
11629 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11631 * decl.cs, typemanager.cs: Avoid using an arraylist
11632 as a buffer if there is only one result set.
11634 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11636 * expression.cs: Make sure you cant call a static method
11637 with an instance expression, bug #56174.
11639 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11641 * class.cs (IsDuplicateImplementation): Improve error reporting to
11642 flag 663 (method only differs in parameter modifier).
11644 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11645 in preprocessor directives.
11647 * location.cs (LookupFile): Allow for the empty path.
11649 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11650 better approach for some of that patch, but its failing with the
11651 CharSet enumeration. For now try/catch will do.
11653 * typemanager.cs: Do not crash if a struct does not have fields.
11656 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11658 * expression.cs: cs0213, cant fix a fixed expression.
11661 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11663 * cs-parser.jay: detect invalid embeded statements gracefully.
11666 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11668 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11671 the invocation type may not be a subclass of the tye of the item/
11672 The type of the item must be a subclass of the invocation item.
11677 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11679 * attribute.cs: Added methods to get a string and a bool from an
11680 attribute. Required to information from AssemblyKeyFileAttribute,
11681 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11682 * codegen.cs: Modified AssemblyName creation to include support for
11683 strongnames. Catch additional exceptions to report them as CS1548.
11684 * compiler.csproj: Updated include CryptoConvert.cs.
11685 * compiler.csproj.user: Removed file - user specific configuration.
11686 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11687 Mono.Security assembly. The original class is maintained and tested in
11688 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11689 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11690 like CSC 8.0 (C# v2) supports.
11691 * Makefile: Added CryptoConvert.cs to mcs sources.
11692 * rootcontext.cs: Added new options for strongnames.
11694 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11696 * driver.cs: For --expect-error, report error code `2'
11697 if the program compiled with no errors, error code `1' if
11698 it compiled with an error other than the one expected.
11700 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11702 * compiler.csproj: Updated for Visual Studio .NET 2003.
11703 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11704 * compiler.sln: Updated for Visual Studio .NET 2003.
11706 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11708 * expression.cs: Fix bug #47234. We basically need to apply the
11709 rule that we prefer the conversion of null to a reference type
11710 when faced with a conversion to 'object' (csc behaviour).
11712 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11714 * statement.cs: Shorter form for foreach, eliminates
11715 a local variable. r=Martin.
11717 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11719 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11720 checks if we can use brtrue/brfalse to test for 0.
11721 * expression.cs: use the above in the test for using brtrue/brfalse.
11722 cleanup code a bit.
11724 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11726 * expression.cs: Rewrite string concat stuff. Benefits:
11728 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11729 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11730 rather than a concat chain.
11732 * typemanager.cs: Add lookups for more concat overloads.
11734 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11736 * expression.cs: Emit shorter il code for array init.
11753 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11755 * statement.cs: Before, two switch blocks would be merged if the
11756 total size of the blocks (end_item - begin_item + 1) was less than
11757 two times the combined sizes of the blocks.
11759 Now, it will only merge if after the merge at least half of the
11764 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11766 * class.cs : csc build fix for GetMethods(). See bug #52503.
11768 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11770 * expression.cs: Make sure fp comparisons work with NaN.
11771 This fixes bug #54303. Mig approved this patch a long
11772 time ago, but we were not able to test b/c the runtime
11775 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11777 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11779 2004-03-19 Martin Baulig <martin@ximian.com>
11781 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11782 two overloads may unify for some type parameter substitutions and
11783 report a CS0408 if appropriate.
11785 2004-03-19 Martin Baulig <martin@ximian.com>
11787 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11788 error here and not in our caller.
11790 2004-03-19 Martin Baulig <martin@ximian.com>
11792 * interface.cs: Completely killed this file.
11793 (Interface): We're now a TypeContainer and live in class.cs.
11795 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11796 argument; we're now also called for interfaces.
11797 (TypeContainer.DefineMembers): Allow this method being called
11799 (TypeContainer.GetMethods): New public method; formerly known as
11800 Interface.GetMethod(). This is used by PendingImplementation.
11801 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11802 it's now private and non-static.
11803 (Interface): Moved this here; it's now implemented similar to
11805 (Method, Property, Event, Indexer): Added `bool is_interface'
11806 argument to their .ctor's.
11807 (MemberBase.IsInterface): New public field.
11809 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11810 instances instead of InterfaceMethod, InterfaceProperty, etc.
11811 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11812 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11814 2004-03-19 Martin Baulig <martin@ximian.com>
11816 * class.cs (MethodCore.IsDuplicateImplementation): New private
11817 method which does the CS0111 checking.
11818 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11819 Use IsDuplicateImplementation().
11821 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11823 * decl.cs (FindMemberToOverride): New method to find the correct
11824 method or property to override in the base class.
11826 - Make Method/Property use the above method to find the
11827 version in the base class.
11828 - Remove the InheritableMemberSignatureCompare as it is now
11831 This patch makes large code bases much faster to compile, as it is
11832 O(n) rather than O(n^2) to do this validation.
11834 Also, it fixes bug 52458 which is that nested classes are not
11835 taken into account when finding the base class member.
11837 Reviewed/Approved by Martin.
11839 2004-03-17 Martin Baulig <martin@ximian.com>
11841 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11842 of type arguments into account; use the `real_num_type_args'
11843 approach like in DoResolveAsTypeStep().
11845 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11848 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11850 * interface.cs: In all interface classes removed redundant
11851 member initialization.
11853 2004-03-16 Martin Baulig <martin@ximian.com>
11855 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11857 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11859 * decl.cs (DefineTypeAndParents): New helper method to define a
11860 type's containers before the type itself is defined; This is a
11861 bug exposed by the recent changes to Windows.Forms when an
11862 implemented interface was defined inside a class that had not been
11865 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11867 (Check): Loop correctly to report errors modifiers
11868 (UNSAFE was not in the loop, since it was the same as TOP).
11870 * interface.cs: Every interface member now takes a ModFlags,
11871 instead of a "is_new" bool, which we set on the base MemberCore.
11873 Every place where we called "UnsafeOk" in the interface, now we
11874 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11875 the unsafe settings from the member declaration instead of the
11876 container interface.
11878 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11880 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11881 `set_indexer_name' to the pending bits (one per type).
11883 We fixed a bug today that was picking the wrong method to
11884 override, since for properties the existing InterfaceMethod code
11885 basically ignored the method name. Now we make sure that the
11886 method name is one of the valid indexer names.
11888 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11890 * support.cs (SeekableStreamReader): Keep track of stream byte
11891 positions and don't mix them with character offsets to the buffer.
11893 Patch from Gustavo Giráldez
11895 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11897 * interface.cs (InterfaceSetGetBase): Removed double member
11898 initialization, base class does it as well.
11900 2004-03-13 Martin Baulig <martin@ximian.com>
11902 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11903 when compiling corlib.
11905 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11907 * convert.cs (ExplicitConversion): We were reporting an error on
11908 certain conversions (object_type source to a value type, when the
11909 expression was `null') before we had a chance to pass it through
11910 the user defined conversions.
11912 * driver.cs: Replace / and \ in resource specifications to dots.
11915 * class.cs: Add check for duplicate operators. Fixes 52477
11917 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11919 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11920 that are in the middle of the statements, not only at the end.
11923 * class.cs (TypeContainer.AddField): No longer set the
11924 `HaveStaticConstructor' flag, now we call it
11925 `UserDefineStaticConstructor' to diferentiate the slightly
11926 semantic difference.
11928 The situation is that we were not adding BeforeFieldInit (from
11929 Modifiers.TypeAttr) to classes that could have it.
11930 BeforeFieldInit should be set to classes that have no static
11935 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11937 And most importantly Zoltan's comment:
11939 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11941 "I think beforefieldinit means 'it's ok to initialize the type sometime
11942 before its static fields are used', i.e. initialization does not need
11943 to be triggered by the first access to the type. Setting this flag
11944 helps the JIT to compile better code, since it can run the static
11945 constructor at JIT time, and does not need to generate code to call it
11946 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11947 this flag for lots of classes like String.
11949 csc sets this flag if the type does not have an explicit static
11950 constructor. The reasoning seems to be that if there are only static
11951 initalizers for a type, and no static constructor, then the programmer
11952 does not care when this initialization happens, so beforefieldinit
11955 This bug prevents the AOT compiler from being usable, since it
11956 generates so many calls to mono_runtime_class_init that the AOT code
11957 is much slower than the JITted code. The JITted code is faster,
11958 because it does not generate these calls if the vtable is type is
11959 already initialized, which is true in the majority of cases. But the
11960 AOT compiler can't do this."
11962 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11964 * class.cs (MethodData.Emit): Refactor the code so symbolic
11965 information is generated for destructors; For some reasons we
11966 were taking a code path that did not generate symbolic information
11969 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11971 * class.cs: Create a Constructor.CheckBase method that
11972 takes care of all validation type code. The method
11973 contains some code that was moved from Define.
11975 It also includes new code that checks for duplicate ctors.
11976 This fixes bug #55148.
11978 2004-03-09 Joshua Tauberer <tauberer@for.net>
11980 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11981 a { ... }-style array creation invokes EmitStaticInitializers
11982 which is not good for reference-type arrays. String, decimal
11983 and now null constants (NullCast) are not counted toward
11984 static initializers.
11986 2004-03-05 Martin Baulig <martin@ximian.com>
11988 * location.cs (SourceFile.HasLineDirective): New public field;
11989 specifies whether the file contains or is referenced by a "#line"
11991 (Location.DefineSymbolDocuments): Ignore source files which
11992 either contain or are referenced by a "#line" directive.
11994 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11996 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11997 direct access to our parent, so check the method inline there.
11999 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12001 * expression.cs (Invocation.EmitCall): Miguel's last commit
12002 caused a regression. If you had:
12007 In Foo the implict this would be null.
12009 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12011 * expression.cs (Invocation.EmitCall): If the method is not
12012 virtual, do not emit a CallVirt to it, use Call.
12014 * typemanager.cs (GetFullNameSignature): Improve the method to
12015 cope with ".ctor" and replace it with the type name.
12017 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12018 as an argument the ConstructorBuilder where it is being defined,
12019 to catch the recursive constructor invocations.
12021 2004-03-16 Martin Baulig <martin@ximian.com>
12023 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12024 ConstructedType, call ResolveType() on it to get the type rather
12025 than just using `expr.Type'.
12027 2004-03-16 Martin Baulig <martin@ximian.com>
12029 * generics.cs (ConstructedType.GetMemberAccess): Take the
12030 EmitContext instead on the TypeExpr and use
12031 ec.TypeContainer.CurrentType/ec.ContainerType.
12033 2004-03-16 Martin Baulig <martin@ximian.com>
12035 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12036 parameters before aliases.
12038 2004-03-16 Martin Baulig <martin@ximian.com>
12040 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12041 New oublic function; checks whether two generic instances may become
12042 equal under some instantiations (26.3.1).
12044 * class.cs (TypeContainer.Define): Call
12045 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12048 2004-03-16 Martin Baulig <martin@ximian.com>
12050 * class.cs (TypeContainer.GetClassBases): Moved
12051 Error_TypeParameterAsBase() here and also check whether the base
12052 class is not an attribute.
12054 2004-03-16 Martin Baulig <martin@ximian.com>
12056 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12058 2004-03-16 Martin Baulig <martin@ximian.com>
12060 * class.cs (Error_TypeParameterAsBase): Use correct error number
12063 2004-03-16 Martin Baulig <martin@ximian.com>
12065 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12068 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12071 2004-03-15 Martin Baulig <martin@ximian.com>
12073 * typemanager.cs (TypeManager.GetFullName): New public method.
12074 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12075 argument; only return members with the correct number of type
12077 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12078 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12079 whether the number of type arguments matches.
12081 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12082 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12084 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12085 field; it's set by the protected .ctor when we're actually a
12086 GenericMemberAccess.
12087 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12088 arguments and pass it to MemberLookupFinal ().
12090 * ecore.cs (Expression.MemberLookup): Added `int
12091 num_type_arguments' argument; only return members with the correct
12092 number of type arguments.
12093 (Expression.MemberLookupFailed): Check whether the MemberLookup
12094 failed because we did not have the correct number of type
12095 arguments; report CS0305 in this case.
12097 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12098 `e.ResolveAsTypeTerminal()' already did so.
12100 2004-03-15 Martin Baulig <martin@ximian.com>
12102 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12103 we're a ConstructedType; in this case, the caller must report an
12104 error (for instance CS0131).
12106 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12107 (TypeArguments.Resolve): Actually report errors here.
12109 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12111 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12112 `set_indexer_name' to the pending bits (one per type).
12114 We fixed a bug today that was picking the wrong method to
12115 override, since for properties the existing InterfaceMethod code
12116 basically ignored the method name. Now we make sure that the
12117 method name is one of the valid indexer names.
12119 2004-03-15 Martin Baulig <martin@ximian.com>
12121 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12122 for generic instances.
12124 2004-03-13 Martin Baulig <martin@ximian.com>
12126 * class.cs (TypeContainer.DefineType): Call
12127 TypeManager.AddUserType() immediately after creating the
12128 TypeBuilder; pass all type parameters when creating the
12131 * decl.cs (DeclSpace.FindNestedType): New public method.
12132 (DeclSpace.FindType): Added `int num_type_args' argument; only
12133 return types with the correct number of type parameters.
12134 (DeclSpace.CountTypeParams): New public property.
12136 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12137 the number of type parameters; defaults to zero.
12139 * generic.cs (TypeArguments.Count): New public property.
12140 (ConstructedType.DoResolveAsTypeStep): First call
12141 ds.FindNestedType() to find out whether we're nested in the
12142 current generic type; in this case, we inherit all type parameters
12143 from the current class.
12145 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12146 num_type_args' argument.
12147 (RootContext.LookupType): Added overloaded version which takes the
12148 number of type arguments; only return types with the correct
12149 number of type arguments.
12151 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12152 checks whether `Type t' has `int num_type_args'.
12154 2004-03-13 Martin Baulig <martin@ximian.com>
12156 * generic.cs (GenericMethod.DefineType): New method; calls
12157 DefineType() on all the type parameters.
12159 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12160 (MethodData.Define): If we're a generic method, call
12161 GenericMethod.DefineType() to define the type parameters.
12163 2004-03-10 Martin Baulig <martin@ximian.com>
12165 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12166 instead of IsAssignableFrom.
12168 2004-03-10 Martin Baulig <martin@ximian.com>
12170 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12172 * support.cs (ParameterData.HasArrayParameter): New property.
12173 (ReflectionParameters.ctor): Take a MethodBase instead of a
12174 ParameterInfo[]. If we have any type parameters, get the generic
12175 method definition and ask it whether we have variable arguments.
12177 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12179 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12180 routines to check if a type is an enumerable/enumerator allow
12181 classes that implement the IEnumerable or IEnumerator interfaces.
12183 * class.cs (Property, Operator): Implement IIteratorContainer, and
12184 implement SetYields.
12186 (Property.Define): Do the block swapping for get_methods in the
12187 context of iterators. We need to check if Properties also
12188 include indexers or not.
12190 (Operator): Assign the Block before invoking the
12191 OperatorMethod.Define, so we can trigger the Iterator code
12194 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12195 Property and Operator classes are not created when we parse the
12196 declarator but until we have the block completed, so we use a
12197 singleton SimpleIteratorContainer.Simple to flag whether the
12198 SetYields has been invoked.
12200 We propagate this setting then to the Property or the Operator to
12201 allow the `yield' to function.
12203 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12205 * codegen.cs: Implemented attribute support for modules.
12206 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12207 Assembly/Module functionality.
12209 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12210 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12211 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12213 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12215 * interface.cs (FindMembers): The operation is performed on all base
12216 interfaces and not only on the first. It is required for future CLS Compliance patch.
12218 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12220 * statement.cs, codegen.cs:
12221 This patch deals with patterns such as:
12223 public class List : IEnumerable {
12225 public MyEnumerator GetEnumerator () {
12226 return new MyEnumerator(this);
12229 IEnumerator IEnumerable.GetEnumerator () {
12233 public struct MyEnumerator : IEnumerator {
12238 Before, there were a few things we did wrong:
12239 1) we would emit callvirt on a struct, which is illegal
12240 2) we emited ldarg when we needed to emit ldarga
12241 3) we would mistakenly call the interface methods on an enumerator
12242 type that derived from IEnumerator and was in another assembly. For example:
12244 public class MyEnumerator : IEnumerator
12246 Would have the interface methods called, even if there were public impls of the
12247 method. In a struct, this lead to invalid IL code.
12249 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12251 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12254 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12256 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12258 * cs-parser.jay: Fix small regression: we were not testing V2
12259 compiler features correctly.
12261 * interface.cs: If the emit context is null, then create one
12263 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12265 * decl.cs (GetSignatureForError): New virtual method to get full name
12266 for error messages.
12268 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12269 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12271 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12272 Duplicated members and code in these classes has been removed.
12273 Better encapsulation in these classes.
12275 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12277 * assign.cs (Assign.DoResolve): When dealing with compound
12278 assignments, there is a new rule in ECMA C# 2.4 (might have been
12279 there before, but it is documented here) that states that in:
12283 If b is of type int, and the `op' is a shift-operator, then the
12284 above is evaluated as:
12288 * expression.cs (Binary.ResolveOperator): Instead of testing for
12289 int/uint/long/ulong, try to implicitly convert to any of those
12290 types and use that in pointer arithmetic.
12292 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12293 method to print information for from the type, not from the
12294 null-method we were given.
12296 2004-02-01 Duncan Mak <duncan@ximian.com>
12298 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12299 parsing for cmd, fixes bug #53694.
12301 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12303 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12304 in the member name duplication tests. Property and operator name duplication
12305 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12307 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12309 * interface.cs (PopulateMethod): Fixed crash when interface method
12310 returns not existing type (error test cs0246-3.cs).
12312 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12314 * cs-parser.jay (interface_accessors): Re-write actions to also
12315 store attributes attached to get and set methods. Fix spelling
12318 (inteface_property_declaration): Modify accordingly.
12320 (InterfaceAccessorInfo): New helper class to store information to pass
12321 around between rules that use interface_accessors.
12323 * interface.cs (Emit): Apply attributes on the get and set
12324 accessors of properties and indexers too.
12326 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12327 right MethodBuilder when applying attributes to the get and set accessors.
12329 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12331 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12333 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12335 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12337 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12339 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12340 changes that treat `yield' specially when present before `break'
12341 or `return' tokens.
12343 * cs-tokenizer.cs: yield is no longer a keyword.
12345 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12347 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12348 setting for default constructors.
12349 For default constructors are almost every time set wrong Modifier. The
12350 generated IL code has been alright. But inside mcs this values was
12351 wrong and this was reason why several of my CLS Compliance tests
12354 2004-02-27 Martin Baulig <martin@ximian.com>
12356 * generics.cs (ConstructedType.ResolveType): Make the nested type
12357 stuff actually work.
12359 2004-02-25 Martin Baulig <martin@ximian.com>
12361 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12362 property; returns the type parameters just from the current type,
12363 ie. with the ones from outer classes.
12364 (DeclSpace.LookupGeneric): First search in the current class, then
12366 (DeclSpace.initialize_type_params): When hiding a type parameter
12367 from an outer class, put it into the `type_param_list' anyways.
12369 * expression.cs (MemberAccess.expr): Made this field protected.
12371 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12372 the type parameters from the current class.
12374 * generic.cs (ConstructedType.ResolveType): Support nested generic
12375 types by taking the type parameters which we inherit from outer
12376 classes into account.
12377 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12378 support for nested generic types.
12380 2004-02-23 Martin Baulig <martin@ximian.com>
12382 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12383 field and check whether we're nested inside a generic type.
12384 (DeclSpace.ResolveType): If we're resolving to a generic type
12385 definition, create a ConstructedType and return its resolved type.
12386 (DeclSpace.initialize_type_params): New private method;
12387 initializes the `type_param_list' field from the type parameters
12388 from this and all enclosing classes.
12389 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12390 we're already initialized.
12392 2004-02-23 Martin Baulig <martin@ximian.com>
12394 * class.cs (Method.Define): Create the generic method before
12395 calling DoDefine().
12396 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12397 the TypeContainer one); we use this for generic methods.
12399 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12400 parent's TypeBuilder.
12402 2004-02-18 Martin Baulig <martin@ximian.com>
12404 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12405 to check for equality.
12407 2004-02-05 Martin Baulig <martin@ximian.com>
12409 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12410 `ec.TypeContainer.CurrentType', use it instead of
12411 `ec.ContainerType' to check whether we're in the type's ctor.
12413 2004-01-29 Martin Baulig <martin@ximian.com>
12415 * expression.cs (Invocation.DoResolve): If we're a
12416 `ConstructedType', then we're actually a generic method, so
12417 rewrite the expr as a GenericMemberAccess.
12419 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12420 here; manually parse it into a string.
12422 2004-01-28 Martin Baulig <martin@ximian.com>
12424 * typemanager.cs (TypeManager.IsEqual): New static method.
12425 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12426 check for equality instead of using `=='.
12428 2004-01-26 Martin Baulig <martin@ximian.com>
12430 * decl.cs (DeclSpace.CurrentType): New public field.
12432 * expression.cs (This.ResolveBase): If we have an
12433 `ec.TypeContainer.CurrentType', use it instead of
12434 `ec.ContainerType'.
12436 * class.cs (TypeContainer.DefineType): If we're a generic type,
12437 create the `CurrentType' (unresolved).
12438 (TypeContainer.GenericType): New private field.
12439 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12440 it and store it in `GenericType' before creating the MemberCache.
12441 (TypeContainer.GetMembers): If we have a `GenericType', call
12442 TypeManager.FindMembers() on it.
12444 * interface.cs (Interface.GenericType): New private field.
12445 (Interface.DefineType): If we're a generic type, create the
12446 `CurrentType' (unresolved).
12447 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12448 and store it in `GenericType' before creating the MemberCache.
12449 (Interface.GetMembers): If we have a `GenericType', call
12450 TypeManager.FindMembers() on it.
12452 2004-01-22 Martin Baulig <martin@ximian.com>
12454 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12455 not a QualifiedIdentifier. This is what `type_name_expression'
12456 was previously doing.
12457 (type_name_expression): Removed; the code is now in
12458 `namespace_or_type_name'.
12459 (qualified_identifier): Removed, use `namespace_or_type_name'
12461 (QualifiedIdentifier): Removed this class.
12463 2004-01-22 Martin Baulig <martin@ximian.com>
12465 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12466 not a string as alias name.
12468 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12470 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12471 #52730 bug, and instead compute correctly the need to use a
12472 temporary variable when requesting an address based on the
12473 static/instace modified of the field and the constructor.
12475 2004-01-21 Martin Baulig <martin@ximian.com>
12477 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12478 class and namespace before looking up aliases. Fixes #52517.
12480 2004-01-21 Martin Baulig <martin@ximian.com>
12482 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12483 assinged in a 'try'; fixes exception4.cs.
12485 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12486 * class.cs : Implemented parameter-less constructor for TypeContainer
12488 * decl.cs: Attributes are now stored here. New property OptAttributes
12490 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12492 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12494 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12496 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12497 (CSharpSignature): New method for indexer and property signature.
12499 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12501 * pending.cs (IsVirtualFilter): Faster implementation.
12503 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12505 * typemanager.cs: Avoid inclusion of same assembly more than once.
12507 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12509 * cs-parser.jay: Fixed problem where the last assembly attribute
12510 has been applied also to following declaration (class, struct, etc.)
12512 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12514 * class.cs: Added error CS0538, CS0539 reporting.
12515 Fixed crash on Microsoft runtime when field type is void.
12517 * cs-parser.jay: Added error CS0537 reporting.
12519 * pending.cs: Added error CS0535 reporting.
12520 Improved error report for errors CS0536, CS0534.
12522 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12524 Merge a few bits from the Anonymous Method MCS tree.
12526 * statement.cs (ToplevelBlock): New class for toplevel methods,
12527 will hold anonymous methods, lifted variables.
12529 * cs-parser.jay: Create toplevel blocks for delegates and for
12530 regular blocks of code.
12532 2004-01-20 Martin Baulig <martin@ximian.com>
12534 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12535 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12536 and `NeedExplicitReturn'; added `IsLastStatement'.
12537 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12538 have a `ReturnLabel' or we're not unreachable.
12540 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12541 child's reachability; don't just override ours with it. Fixes
12542 #58058 (lluis's example).
12543 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12544 InFinally(), InLoop(), InSwitch() and
12545 BreakCrossesTryCatchBoundary() methods.
12547 * statement.cs (Return): Do all error checking in Resolve().
12548 Unless we are the last statement in a top-level block, always
12549 create a return label and jump to it.
12550 (Break, Continue): Do all error checking in Resolve(); also make
12551 sure we aren't leaving a `finally'.
12552 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12553 statement in a top-level block.
12554 (Block.Flags): Added `IsDestructor'.
12555 (Block.IsDestructor): New public property.
12557 2004-01-20 Martin Baulig <martin@ximian.com>
12559 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12561 2004-01-20 Martin Baulig <martin@ximian.com>
12563 * statement.cs (Statement.ResolveUnreachable): New public method.
12564 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12565 (Block.Resolve): Resolve unreachable statements.
12567 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12569 * expression.cs: We need to fix the case where we do
12570 not have a temp variable here.
12572 * assign.cs: Only expression compound assignments need
12573 temporary variables.
12575 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12577 * flowanalysis.cs: Reduce memory allocation in a few ways:
12578 - A block with no variables should not allocate a bit
12580 - A method with no out parameters does not need any tracking
12581 for assignment of the parameters, so we need not allocate
12584 public readonly Type[] VariableTypes;
12585 public readonly string[] VariableNames;
12586 Are redundant. The data is already stored in the variable
12587 map, so we need not allocate another array for it.
12588 - We need to add alot of checks for if (params | locals) == null
12589 due to the first two changes.
12591 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12593 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12594 implement IMemoryLocation, we store a copy on a local variable and
12595 take the address of it. Patch from Benjamin Jemlich
12597 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12598 to use a special "type_name_expression" rule which reduces the
12599 number of "QualifiedIdentifier" classes created, and instead
12600 directly creates MemberAccess expressions.
12602 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12604 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12605 that fixes #52853. Null literal assignment to ValueType
12607 * class.cs (MethodData.Emit): Instead of checking the name of the
12608 method to determine if its a destructor, create a new derived
12609 class from Method called Destructor, and test for that.
12611 * cs-parser.jay: Create a Destructor object instead of a Method.
12613 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12617 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12619 * expression.cs (Binary.ResolveOperator): Perform an implicit
12620 conversion from MethodGroups to their delegate types on the
12621 Addition operation.
12623 * delegate.cs: Introduce a new class DelegateCreation that is the
12624 base class for `NewDelegate' and `ImplicitDelegateCreation',
12625 factor some code in here.
12627 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12628 conversion from MethodGroups to compatible delegate types.
12630 * ecore.cs (Expression.Resolve): Do not flag error 654
12631 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12632 we allow conversions from MethodGroups to delegate types now.
12634 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12635 assignments in v2 either.
12637 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12639 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12640 static read-only fields in ctors.
12642 Applied patch from Benjamin Jemlich
12644 * expression.cs (UnaryMutator): Avoid leaking local variables.
12646 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12648 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12649 here to return true, as they can be used like this:
12651 (XXX) int.MEMBER ()
12653 Fixed 49836 and all the other dups
12655 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12657 * driver.cs: Implement /win32res and /win32icon.
12659 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12661 * cs-parser.jay: Add a rule to improve error handling for the
12662 common mistake of placing modifiers after the type.
12664 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12666 * cs-parser.jay (interface_event_declaration): Catch
12667 initialization of events on interfaces, and report cs0068
12669 * cs-parser.jay (interface_event_declaration): Catch
12670 initialization of events.
12672 * ecore.cs: Better report missing constructors.
12674 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12675 the error reporting done in the wrong place. Fix.
12677 * expression.cs (Binary.ResolveOperator): Catch the
12678 operator + (E x, E y) error earlier, and later allow for implicit
12679 conversions in operator +/- (E e, U x) from U to the underlying
12682 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12683 52596, if the container class is abstract, the default constructor
12684 is protected otherwise its public (before, we were always public).
12686 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12689 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12690 Jemlich that fixes bug #52597, MCS was generating invalid code for
12691 idisposable structs. Thanks to Ben for following up with this
12694 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12696 * driver.cs: Allow assemblies without code to be generated, fixes
12699 2004-01-07 Nick Drochak <ndrochak@gol.com>
12701 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12703 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12705 * cs-parser.jay: Add rules to improve error reporting if fields or
12706 methods are declared at the namespace level (error 116)
12708 * Add rules to catch event add/remove
12710 2004-01-04 David Sheldon <dave-mono@earth.li>
12712 * expression.cs: Added matching ")" to error message for
12715 2004-01-03 Todd Berman <tberman@gentoo.org>
12717 * ecore.cs, attribute.cs:
12718 Applying fix from #52429.
12720 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12722 * ecore.cs, expression.cs, statement.cs:
12723 Total rewrite of how we handle branching. We
12724 now handle complex boolean expressions with fewer
12725 jumps. As well if (x == 0) no longer emits a ceq.
12727 if (x is Foo) is much faster now, because we generate
12730 Overall, we get a pretty big improvement on our benchmark
12731 tests. The code we generate is smaller and more readable.
12733 I did a full two-stage bootstrap. The patch was reviewed
12734 by Martin and Miguel.
12736 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12738 * cs-parser.jay: Make primary_expression not take a QI.
12739 we dont need this because the member_access rule covers
12740 us here. So we replace the rule with just IDENTIFIER.
12742 This has two good effects. First, we remove a s/r conflict.
12743 Second, we allocate many fewer QualifiedIdentifier objects.
12745 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12747 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12748 set the correct information via SRE. This prevents
12749 hanging on the MS runtime. Fixes #29374.
12751 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12753 * convert.cs: correctly handle conversions to value types
12754 from Enum and ValueType as unboxing conversions.
12756 Fixes bug #52569. Patch by Benjamin Jemlich.
12758 2004-01-02 Ravi Pratap <ravi@ximian.com>
12760 * expression.cs (BetterConversion): Prefer int -> uint
12761 over int -> ulong (csc's behaviour). This fixed bug #52046.
12763 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12765 * decl.cs (MemberCache.FindMembers): now returns a
12768 * typemanager.cs: In general, go with with ^^.
12769 (CopyNewMethods): take an IList.
12770 (RealMemberLookup): Only allocate an arraylist
12771 if we copy from two sets of methods.
12773 This change basically does two things:
12774 1) Fewer array lists allocated due to CopyNewMethods.
12775 2) the explicit cast in MemberList costed ALOT.
12777 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12779 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12780 a hashtable to avoid needless string allocations when an identifier is
12781 used more than once (the common case).
12783 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12785 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12786 is broken, it will not return anything. So, we
12787 have to use the information we have in mcs to
12790 * typemanager.cs: Add a cache for GetInterfaces,
12791 since this will now be used more often (due to ^^)
12793 (GetExplicitInterfaces) New method that gets the
12794 declared, not effective, interfaces on a type
12795 builder (eg, if you have interface IFoo, interface
12796 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12799 This patch makes MCS able to bootstrap itself on
12802 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12804 * expression.cs: Remove the Nop's that Miguel put
12807 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12809 * report.cs, codegen.cs: Give the real stack trace to
12810 the error when an exception is thrown.
12812 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12814 * decl.cs: only allocate hashtables for ifaces if
12817 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12819 * expression.cs: fix the error from cs0121-2.cs
12820 (a parent interface has two child interfaces that
12821 have a function with the same name and 0 params
12822 and the function is called through the parent).
12824 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12826 * class.cs, rootcontext.cs, typmanager.cs: do not
12829 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12831 * codegen.cs: remove stack for the ec flow branching.
12832 It is already a linked list, so no need.
12834 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12836 * Makefile: Allow custom profiler here.
12838 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12840 * typemanager.cs (LookupType):
12841 - Use a static char [], because split takes
12842 a param array for args, so it was allocating
12844 - Do not store true in a hashtable, it boxes.
12846 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12848 * flowanalysis.cs: bytify common enums.
12850 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12852 * modifiers.cs: Add a new set of flags for the
12853 flags allowed on explicit interface impls.
12854 * cs-parser.jay: catch the use of modifiers in
12855 interfaces correctly.
12856 * class.cs: catch private void IFoo.Blah ().
12858 All related to bug #50572.
12860 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12862 * decl.cs: Rewrite the consistant accessability checking.
12863 Accessability is not linear, it must be implemented in
12864 a tableish way. Fixes #49704.
12866 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12868 * expression.cs: Handle negation in a checked context.
12869 We must use subtraction from zero. Fixes #38674.
12871 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12873 * class.cs: Ignore static void main in DLLs.
12874 * rootcontext.cs: Handle the target type here,
12875 since we are have to access it from class.cs
12876 * driver.cs: account for the above.
12878 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12880 * report.cs: Give line numbers and files if available.
12882 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12884 * driver.cs: Implement /addmodule.
12886 * typemanager.cs: Change 'modules' field so it now contains Modules not
12889 2003-12-20 Martin Baulig <martin@ximian.com>
12891 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12892 (FieldBase.IsAssigned): Removed this field.
12893 (FieldBase.SetAssigned): New public method.
12894 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12896 2003-12-20 Martin Baulig <martin@ximian.com>
12898 * expression.cs (LocalVariableReference.DoResolve): Don't set
12899 `vi.Used' if we're called from DoResolveLValue().
12901 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12902 returns the usage vector it just merged into the current one -
12903 pass this one to UsageWarning().
12904 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12905 of the `EmitContext', don't call this recursively on our children.
12907 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12909 * driver.cs: Implement /target:module.
12911 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12913 * support.cs (CharArrayHashtable): New helper class.
12915 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12916 char arrays, not strings, so we can avoid creating a string in
12917 consume_identifier if the identifier is a keyword.
12919 2003-12-16 Martin Baulig <martin@ximian.com>
12921 * statement.cs (LocalInfo.Assigned): Removed this property.
12922 (LocalInfo.Flags): Removed `Assigned'.
12923 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12924 and uses flow analysis.
12925 (Block.UsageWarning): Made this method private.
12926 (Block.Resolve): Call UsageWarning() if appropriate.
12928 * expression.cs (LocalVariableReference.DoResolve): Always set
12929 LocalInfo.Used here.
12931 2003-12-13 Martin Baulig <martin@ximian.com>
12933 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12934 any value here; we're now using flow analysis to figure out
12935 whether a statement/block returns a value.
12937 2003-12-13 Martin Baulig <martin@ximian.com>
12939 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12941 (FlowBranching.MergeFinally): Don't call
12942 `branching.CheckOutParameters()' here, this is called in
12944 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12945 when adding the `finally' vector.
12947 2003-12-13 Martin Baulig <martin@ximian.com>
12950 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12951 actually work and also fix #48962.
12953 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12955 * decl.cs: Do not check System.Object for nested types,
12956 since we know it does not have any. Big bang for buck:
12959 Run 1: 8.35 seconds
12960 Run 2: 8.32 seconds
12961 corlib: 17.99 seconds
12963 Run 1: 8.17 seconds
12964 Run 2: 8.17 seconds
12965 corlib: 17.39 seconds
12967 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12969 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12970 time we are returning 0 members, so we save alot here.
12972 2003-12-11 Martin Baulig <martin@ximian.com>
12974 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12975 `MergeChild()', also just take the `FlowBranching' as argument;
12976 call Merge() on it and return the result.
12977 (FlowBranching.Merge): We don't need to do anything if we just
12980 2003-12-11 Martin Baulig <martin@ximian.com>
12982 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12983 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12984 Maurer for this idea.
12986 2003-12-11 Martin Baulig <martin@ximian.com>
12988 * flowanalysis.cs (MergeResult): This class is now gone; we now
12989 use the `UsageVector' for this. The reason for this is that if a
12990 branching just has one sibling, we don't need to "merge" them at
12991 all - that's the next step to do.
12992 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12995 2003-12-11 Martin Baulig <martin@ximian.com>
12997 Reworked flow analyis and made it more precise and bug-free. The
12998 most important change is that we're now using a special `Reachability'
12999 class instead of having "magic" meanings of `FlowReturns'. I'll
13000 do some more cleanups and optimizations and also add some more
13001 documentation this week.
13003 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13004 largely reworked this class.
13005 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13006 the new `Reachability' class instead of having "magic" values here.
13007 (FlowBranching): We're now using an instance of `Reachability'
13008 instead of having separate `Returns', `Breaks' etc. fields.
13010 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13011 based on flow analysis; ignore the return value of block.Emit ().
13013 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13015 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13016 if they are private.
13018 2003-12-09 Martin Baulig <martin@ximian.com>
13020 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13021 call them directly on the UsageVector.
13023 2003-12-09 Martin Baulig <martin@ximian.com>
13025 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13026 Changed return type from `FlowReturns' to `Reachability'.
13028 2003-12-09 Martin Baulig <martin@ximian.com>
13030 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13031 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13032 `Reachable' fields with a single `Reachability' one.
13034 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13036 * class.cs (FindMembers): Remove foreach's.
13041 Run 1: 8.74 seconds
13042 Run 2: 8.71 seconds
13045 Run 1: 8.64 seconds
13046 Run 2: 8.58 seconds
13049 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13054 This patch does a few things:
13055 1. EmptyStatement is now a singleton, so it is never reallocated.
13056 2. All blah is EmptyStatement constructs have been changed to
13057 blah == EmptyStatement.Value, which is much faster and valid
13058 now that EmptyStatement is a singleton.
13059 3. When resolving a block, rather than allocating a new array for
13060 the non-empty statements, empty statements are replaced with
13061 EmptyStatement.Value
13062 4. Some recursive functions have been made non-recursive.
13063 Mainly the performance impact is from (3), however (1) and (2) are needed for
13064 this to work. (4) does not make a big difference in normal situations, however
13065 it makes the profile look saner.
13070 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13071 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13072 Total memory allocated: 56397 KB
13075 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13076 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13077 Total memory allocated: 55666 KB
13079 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13081 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13082 than the hashtable in a hashtable version
13084 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13085 we always end up concating a string. This results in a huge perf
13086 loss, because many strings have to be tracked by the GC. In this
13087 patch, we first use a hashtable that works with two keys, so that
13088 the strings do not need to be concat'ed.
13092 Run 1: 8.74 seconds
13093 Run 2: 8.71 seconds
13096 Run 1: 8.65 seconds
13097 Run 2: 8.56 seconds
13099 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13101 * Makefile: Add a new target `do-time' that does a quick and simple
13102 profile, leaving easy to parse output.
13104 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13106 * codegen.cs (Init): Create the dynamic assembly with
13107 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13109 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13111 * support.cs: Make the PtrHashtable use only one
13112 instance of its comparer.
13114 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13116 * typemanager.cs: Fix lookup of GetNamespaces.
13118 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13120 * expression.cs: Removed redundant line.
13122 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13123 ArrayLists, use for loops with bounds.
13125 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13128 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13129 arraylists, use for loop with bounds.
13131 The above three changes give us a 0.071 second performance
13132 improvement out of 3.294 seconds down to 3.223. On my machine
13133 the above changes reduced the memory usage by 1,387 KB during
13134 compiler bootstrap.
13136 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13137 QualifiedIdentifiers. Before we created a new string through
13138 concatenation, and mostly later on, the result would be
13139 manipulated by DecomposeQI through string manipulation.
13141 This reduced the compiler memory usage for bootstrapping from
13142 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13143 compile times in 0.05 seconds.
13145 2003-11-28 Dick Porter <dick@ximian.com>
13147 * support.cs: Do string compares with the Invariant culture.
13155 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13156 the comparison is done with the Invariant culture.
13158 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13160 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13161 GetEnumerator method.
13163 (ProbeCollectionType): Iterate starting at the most specific type
13164 upwards looking for a GetEnumerator
13166 * expression.cs: Shift count can be up to 31 for int/uint and 63
13169 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13171 * statement.cs (Block.LookupLabel): Also look for the label on the
13172 children blocks. Use a hash table to keep track of visited
13175 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13176 we actually did transform the other operand, otherwise fall back
13177 to the common codepath that casts to long.
13179 * cs-tokenizer.cs: Use the same code pattern as the int case.
13180 Maybe I should do the parsing myself, and avoid depending on the
13181 Parse routines to get this done.
13183 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13185 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13186 which fixes bug 51347. This time test it.
13188 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13189 attributes for example can not tell the difference between these.
13190 The difference was only a syntax feature of the language.
13192 * attribute.cs: Apply attributes to delegates.
13194 * delegate.cs: Call the apply attributes method.
13196 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13198 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13199 comparing 0 vs Byte.MinValue, not the value
13201 (ImplicitConversionRequired): When reporting a conversion error,
13202 use error 31 to print out the constant error instead of the
13205 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13206 which fixes bug 51347.
13208 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13210 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13211 which fixes the -warnaserror command line option.
13213 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13215 * cfold.cs (DoNumericPromotions): During constant folding of
13216 additions on UIntConstant, special case intconstants with
13217 IntConstants like we do on the expression binary operator.
13219 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13221 * convert.cs (ImplicitReferenceConversion): We were missing a case
13222 (System.Enum are not value types or class types, so we need to
13223 classify them separatedly).
13225 * driver.cs: We do not support error 2007.
13227 2003-11-12 Jackson Harper <jackson@ximian.com>
13229 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13230 system directory. Also use the full file name so users can
13231 libraries names mscorlib-o-tron.dll in a non system dir.
13233 2004-01-04 David Sheldon <dave-mono@earth.li>
13235 * expression.cs: Added matching ")" to error message for CS0077.
13237 2003-12-19 Martin Baulig <martin@ximian.com>
13239 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13240 static method; see documentation in the method.
13241 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13243 * convert.cs (Convert.ImplicitReferenceConversion,
13244 Convert.ImplicitReferenceConversionExists): Add support for
13245 generic type declarations; see gen-36.cs.
13247 2003-12-19 Martin Baulig <martin@ximian.com>
13249 * pending.cs (Pending.InterfaceMethod): Use
13250 `Type.IsAssignableFrom()' instead of `=='.
13252 2003-12-18 Martin Baulig <martin@ximian.com>
13254 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13257 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13258 `expr_type.Equals (target_type)' instead of `=='.
13260 2003-12-08 Martin Baulig <martin@ximian.com>
13262 * generics.cs (Constraints.Types): Removed.
13263 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13265 (Constraints.ResolveTypes): New public method; resolves the
13266 TypeExpr's to Type's.
13267 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13268 longer takes the constraints.
13269 (TypeParameter.DefineMethod): Likewise.
13270 (TypeParameter.DefineType): New public method. Calls
13271 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13274 2003-12-08 Martin Baulig <martin@ximian.com>
13276 * convert.cs (Convert.ImplicitConversionStandard): Use
13277 `expr_type.Equals (target_type)' instead of `=='.
13279 2003-12-08 Martin Baulig <martin@ximian.com>
13281 * typemanager.cs (TypeManager.GetReferenceType): Call
13282 `Type.MakeByRefType ()'.
13284 2003-12-08 Martin Baulig <martin@ximian.com>
13286 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13287 just has some special meaning in some situations. For instance,
13288 it is allowed to use `where' as the name of a variable etc.
13290 2003-12-04 Martin Baulig <martin@ximian.com>
13292 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13293 `Type.MakeArrayType()' for array types.
13295 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13297 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13300 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13303 2003-11-16 Martin Baulig <martin@ximian.com>
13305 * codegen.cs (EmitContext.IsGeneric): Removed.
13307 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13308 ResolveGeneric() on the DeclSpace.
13310 2003-11-16 Martin Baulig <martin@ximian.com>
13312 * generic.cs (TypeArguments.Resolve):
13313 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13314 `ResolveType()' on it to get the Type.
13316 2003-11-15 Martin Baulig <martin@ximian.com>
13318 * generic.cs (ConstructedType.GetInterfaces): Override this.
13320 2003-11-14 Martin Baulig <martin@ximian.com>
13322 * interface.cs (Interface.DefineType): Define all type parameters
13323 before adding the interfaces we inherit.
13325 2003-11-11 Martin Baulig <martin@ximian.com>
13327 * generic.cs (ConstructedType.ResolveType): Always call
13328 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13330 2003-11-10 Martin Baulig <martin@ximian.com>
13332 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13333 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13334 calling `ResolveType()' on them, directly assign their `Type'.
13336 2003-11-08 Martin Baulig <martin@ximian.com>
13338 * generic.cs (ConstructedType): Override `IsClass' etc.
13340 2003-11-08 Martin Baulig <martin@ximian.com>
13342 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13343 return value and the `out parent' parameter.
13344 (TypeContainer.DefineType): Moved the CS0644 check into
13345 GetClassBases(). Don't pass the interface types to the
13346 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13347 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13349 * ecore.cs (TypeExpr.IsAttribute): New property.
13350 (TypeExpr.GetInterfaces): New method.
13352 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13353 TypeExpr instead of a Type.
13354 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13355 (Interface.DefineType): Don't pass the interface types to the
13356 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13357 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13359 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13360 instead of a `Type[]'.
13361 (TypeManager.RegisterBuilder): Likewise.
13362 (TypeManager.AddUserInterface): Likewise.
13363 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13364 `Type[]' and also return a `TypeExpr[]'.
13365 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13367 2003-11-08 Martin Baulig <martin@ximian.com>
13369 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13372 2003-11-08 Martin Baulig <martin@ximian.com>
13374 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13375 TypeManager.ResolveExpressionTypes().
13377 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13378 instead of an Expression.
13379 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13380 (TypeExpression): New public class; formerly known as `TypeExpr'.
13382 * expression.cs (ComposedCast): Derive from TypeExpr.
13384 * typemanager.cs (TypeManager.system_*_expr): These are now
13385 TypExpr's instead of Expression's.
13386 (TypeManager.ResolveExpressionTypes): New public static function;
13387 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13390 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13392 * expression.cs (New.DoResolve): Do not dereference value that
13393 might be a null return.
13395 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13396 sure that the constant value has the right type. Fixes an
13397 unreported bug, similar to 50425.
13399 * const.cs (Const.LookupConstantValue): Call
13400 ImplicitStandardConversionExists before doing a conversion to
13401 avoid havng the TypeManager.ChangeType do conversions.
13403 Reduced the number of casts used
13405 (Const.ChangeType): New routine to enable reuse of the constant
13406 type changing code from statement.
13408 * typemanager.cs (ChangeType): Move common initialization to
13409 static global variables.
13413 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13414 every value type to go through, even if it was void. Fix that.
13416 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13417 character of the define, and the is_identifier_part_character for
13418 the rest of the string.
13420 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13422 * expression.cs (UnaryMutator.EmitCode): When I updated
13423 LocalVariableReference.DoResolve, I overdid it, and dropped an
13424 optimization done on local variable references.
13426 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13428 * ecore.cs: Convert the return from Ldlen into an int.
13430 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13432 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13433 the accessibility, this is a special case for toplevel non-public
13434 classes (internal for instance).
13436 2003-10-20 Nick Drochak <ndrochak@gol.com>
13438 * ecore.cs: Fix typo and build. Needed another right paren.
13440 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13442 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13443 `internal' case regular and protected, but not allowing protected
13444 to be evaluated later. Bug 49840
13446 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13448 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13449 to kb.Nlast, and not the kb.nFirst to isolate the switch
13452 Extract the underlying type, so enumerations of long/ulong are
13453 treated like long/ulong.
13455 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13457 * expression.cs (New): Overload the meaning of RequestedType to
13458 track the possible creation of the NewDelegate type, since
13459 DoResolve is invoked more than once for new constructors on field
13462 See bugs: #48800 and #37014
13464 * cs-parser.jay (declare_local_constants): Take an arraylist
13465 instead of a single constant.
13467 (local_constant_declaration): It should take a
13468 constant_declarators, not a constant_declarator. Fixes 49487
13470 * convert.cs: Fix error report.
13472 2003-10-13 Jackson Harper <jackson@ximian.com>
13474 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13477 2003-11-03 Martin Baulig <martin@ximian.com>
13479 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13480 `out bool has_type_arg'; if set, we need to pass the type to
13482 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13483 Stelem_Any/Ldelem_Any for generic parameters.
13485 2003-11-02 Martin Baulig <martin@ximian.com>
13487 * expression.cs (Invocation.EmitCall): Use
13488 `TypeManager.IsValueType()' to check whether it's a value type.
13489 Don't set `struct_call' when calling a method on a type parameter.
13491 2003-11-02 Martin Baulig <martin@ximian.com>
13493 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13494 and removed the TypeBuilder argument.
13496 * typemanager.cs (TypeManager.IsValueType): Return
13497 `t.IsGenericParameter || t.IsValueType'.
13499 2003-10-25 Martin Baulig <martin@ximian.com>
13501 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13502 call ConstructedType.Resolve() on it.
13504 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13506 2003-10-25 Martin Baulig <martin@ximian.com>
13508 * class.cs (TypeContainer.GetClassBases): Changed
13509 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13510 CS8214 reporting here.
13511 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13512 instead of a `Type' for our parent. In case of a recursive
13513 declaration (see tests/gen-23.cs for an example), our parent is a
13514 ConstructedType and it doesn't have its type set. So, first
13515 create our own TypeBuilder, then call constructed.Resolve() to get
13516 the parent's type and finally TypeBuilder.SetParent() it.
13518 * ecore.cs (TypeExpr.Name): New public virtual property.
13521 (ConstructedType): We're now a TypeExpr and not just an Expression.
13522 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13523 arguments here; this is done later.
13524 (ConstructedType.Resolve): New public method to resolve the type
13525 arguments and bind them.
13527 2003-10-21 Martin Baulig <martin@ximian.com>
13529 * convert.cs: Use `TypeManager.IsValueType' instead of
13530 'type.IsValueType' everywhere.
13532 * typemanager.cs (TypeManager.IsValueType): Return true for type
13533 parameters. The reason for this is that we need to box a type
13534 parameter when converting it to a reference type.
13536 * cs-parser.jay: Added support for default value expressions.
13538 * generics.cs (DefaultValueExpression): New public class.
13540 2003-10-17 Martin Baulig <martin@ximian.com>
13542 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13543 TypeContainer so we can also use this for Interfaces.
13544 (TypeParameter.Resolve): Likewise.
13546 * interface.cs (Interface.DefineType): Added support for generic
13549 * cs-parser.jay: Added support for generic structs and interfaces.
13551 2003-10-17 Martin Baulig <martin@ximian.com>
13553 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13554 call generic methods :-)
13556 2003-10-16 Martin Baulig <martin@ximian.com>
13558 * cs-parser.jay (namespace_or_type_name): Only create a
13559 GenericMemberAccess if we actually have type arguments.
13561 2003-10-13 Martin Baulig <martin@ximian.com>
13563 * class.cs (Method.Define): If we're a generic method, call
13564 TypeBuilder.DefineGenericMethod () before resolving
13566 (MethodData): Added .ctor which takes an additional MethodBuilder
13567 argument; this is used for generic methods.
13568 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13569 we already have a MethodBuilder.
13571 2003-10-10 Martin Baulig <martin@ximian.com>
13573 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13574 instead of a `DeclSpace'. This is used for generic methods.
13576 * cs-parser.jay (method_header): Added support for generic
13577 methods; create a `GenericMethod' instance and pass it to the
13578 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13579 parameters and locals.
13581 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13582 since we already have the location. Check whether we're a generic
13583 type declaration or a generic method and create the correct type
13586 * generic.cs (TypeParameter.DefineMethod): New public method.
13587 (GenericMethod): New public class; derives from DeclSpace and is
13588 used for generic methods.
13590 2003-10-09 Martin Baulig <martin@ximian.com>
13592 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13594 (MethodCore.DoDefineParameters): Removed the TypeContainer
13595 argument; use the DeclSpace which was passed to the .ctor instead.
13596 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13597 TypeContainer; we only need a DeclSpace here.
13599 2003-10-09 Martin Baulig <martin@ximian.com>
13601 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13603 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13604 EmitContext's .ctor.
13606 2003-10-09 Martin Baulig <martin@ximian.com>
13608 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13609 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13610 AsAccessible(), moved them as well.
13612 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13614 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13616 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13617 generation for >=, as spotted by Paolo, bug 48679.
13618 Patch from David Waite.
13620 * cs-tokenizer.cs: Add handling for #pragma.
13622 * cs-parser.jay: Allow for both yield and yield return in the
13623 syntax. The anti-cobolization of C# fight will go on!
13625 * class.cs (TypeBuilder.DefineType): Catch error condition here
13626 (Parent.DefineType erroring out and returning null).
13628 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13629 coping with enumerations variables, we were mistakenly processing
13630 them as a regular value type instead of built-in types. Fixes the
13633 * typemanager.cs (IsBuiltinOrEnum): New method.
13635 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13637 * cs-parser.jay: Upgrade: yield now needs the return clause.
13639 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13641 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13643 2003-09-29 Martin Baulig <martin@ximian.com>
13645 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13646 inflated generic methods.
13648 * generics.cs (ConstructedType): Distinguish between open and
13649 closed constructed types; correctly resolve the arguments.
13651 2003-09-22 Martin Baulig <martin@ximian.com>
13653 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13654 all type arguments meet their constraints.
13656 2003-09-19 Martin Baulig <martin@ximian.com>
13658 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13659 `MemberCache parent' argument. Normally, an interface doesn't
13660 have a parent type except System.Object, but we use this in gmcs
13661 for generic type parameters.
13663 2003-09-18 Martin Baulig <martin@ximian.com>
13665 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13666 on `type.IsInterface'; don't check whether the type has a parent
13667 to determine whether it's an interface.
13669 2003-09-17 Martin Baulig <martin@ximian.com>
13671 * generic.cs (ConstructedType.ToString): Always use `name' as the
13674 2003-09-15 Martin Baulig <martin@ximian.com>
13676 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13678 * generic.cs (Constraints.Resolve): New public method; this is
13679 called to resolve the constraint types and to check whether all
13680 the constraints are correct.
13681 (Constraints.Types): New public property.
13682 (TypeParameter.Resolve): New public method; resolves all the
13683 type's constraints.
13685 * class.cs (TypeContainer.DefineType): Call
13686 TypeParameter.Resolve() before actually defining the type.
13688 2003-09-15 Martin Baulig <martin@ximian.com>
13690 * class.cs (TypeContainer.DefineType): Added an error flag to
13691 avoid reporting duplicate CS0146's ("class definition is
13694 * driver.cs (Driver.MainDriver): Abort if
13695 RootContext.ResolveTree() reported any errors.
13697 2003-09-07 Martin Baulig <martin@ximian.com>
13699 * report.cs (Error, Warning): Added overloaded versions which take
13700 a `params object[] args' and call String.Format().
13702 2003-09-07 Martin Baulig <martin@ximian.com>
13704 * decl.cs (DeclSpace..ctor): Don't call
13705 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13706 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13707 (DeclSpace.RecordDecl): New method.
13709 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13711 2003-09-02 Ravi Pratap <ravi@ximian.com>
13713 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13714 value attributes to be applied to ParameterBuilders.
13716 * class.cs (MethodCore.LabelParameters): Make static and more
13717 generic so that it can be used from other places - like interface
13718 methods, for instance.
13720 * interface.cs (Interface.Emit): Call LabelParameters before
13721 emitting attributes on the InterfaceMethod.
13723 2003-09-07 Martin Baulig <martin@ximian.com>
13725 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13726 if the number of type parameters doesn't match.
13728 2003-09-04 Martin Baulig <martin@ximian.com>
13730 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13731 for arrays of generic type params (ie. `!0[]').
13733 2003-09-04 Martin Baulig <martin@ximian.com>
13735 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13738 2003-09-04 Martin Baulig <martin@ximian.com>
13740 * decl.cs (DeclSpace.LookupGeneric): New method.
13741 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13744 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13745 argument, not just a string.
13746 (TypeParameter.Define): New public method; this is called to
13747 actually define the generic parameter; after this, you can use the
13748 new `Type' property to get the type.
13750 2003-09-04 Martin Baulig <martin@ximian.com>
13752 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13753 is now an ArrayList; initialize the result of the `TypeParameters'
13755 (DeclSpace.GetGenericData): Removed.
13756 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13757 implement this in a different way.
13758 (DeclSpace.GetTypeParameters): Removed; there's now a
13759 `TypeParameters' property.
13760 (DeclSpace.TypeParameters): New public property.
13762 * generic.cs (Constraints): Make this class public.
13763 (TypeParameter): New public class.
13765 2003-09-04 Martin Baulig <martin@ximian.com>
13767 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13768 generic parameters.
13770 * class.cs (TypeContainer.DefineType): Call
13771 TypeBuilder.DefineGenericParameter () on all generic parameters if
13772 this is a generic type.
13774 2003-08-28 Martin Baulig <martin@ximian.com>
13776 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13779 * sample-hello.cs: Compile this with gmcs: "gmcs
13780 /r:sample-stack.dll sample-hello.cs".
13782 2003-08-28 Martin Baulig <martin@ximian.com>
13784 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13785 the parameters to the generic type.
13787 2003-08-28 Martin Baulig <martin@ximian.com>
13789 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13791 2003-08-28 Martin Baulig <martin@ximian.com>
13793 * cs-parser.jay (opt_type_argument_list): Use
13794 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13795 (primary_expression): Replace `qualified_identifier' with `type_name'.
13796 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13798 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13799 parser to check whether it is syntactically a type parameter list;
13800 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13803 2003-08-26 Martin Baulig <martin@ximian.com>
13805 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13806 resolving aliases; fixes #47927.
13808 2003-08-26 Martin Baulig <martin@ximian.com>
13810 * statement.cs (Using.DoResolve): This is internally emitting a
13811 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13812 do not always return. Fixes #47681.
13814 2003-08-26 Martin Baulig <martin@ximian.com>
13816 * decl.cs (MemberCore): Moved WarningNotHiding(),
13817 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13819 (AdditionResult): Make this nested in DeclSpace.
13820 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13821 argument; call NamespaceEntry.Define() unless we're nested in a
13824 * namespace.cs (Namespace.DefineName): New public function. This
13825 is called from DeclSpace's .ctor to add
13826 (Namespace.Lookup): Include DeclSpaces in the lookup.
13828 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13830 * const.cs (Const): Derive from MemberBase, not MemberCore.
13832 2003-08-25 Martin Baulig <martin@ximian.com>
13834 * convert.cs (Convert.ExplicitReferenceConversion): When
13835 converting from an interface type to a class, unbox if the target
13836 type is a struct type. Fixes #47822.
13838 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13840 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13843 2003-08-22 Martin Baulig <martin@ximian.com>
13845 * class.cs (TypeManager.DefineType): When defining a nested type,
13846 call DefineType() on our parent; fixes #47801.
13848 2003-08-22 Martin Baulig <martin@ximian.com>
13850 * class.cs (MethodData.Define): While checking if a method is an
13851 interface implementation, improve the test a bit more to fix #47654.
13853 2003-08-22 Martin Baulig <martin@ximian.com>
13855 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13856 correctly; fixes #47722.
13858 2003-08-22 Martin Baulig <martin@ximian.com>
13860 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13861 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13863 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13865 2003-08-22 Martin Baulig <martin@ximian.com>
13867 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13868 can only be assigned in static constructors. Fixes #47161.
13870 2003-08-22 Martin Baulig <martin@ximian.com>
13872 Rewrote and improved the flow analysis code.
13874 * flowbranching.cs (FlowBranching): Make this class abstract.
13875 (FlowBranching.CreateBranching): New static function to create a
13876 new flow branching.
13877 (FlowBranchingBlock, FlowBranchingException): New classes.
13878 (FlowBranching.UsageVector.Type): New public readonly field.
13879 (FlowBranching.UsageVector.Breaks): Removed the setter.
13880 (FlowBranching.UsageVector.Returns): Removed the setter.
13881 (FlowBranching.UsageVector): Added Break(), Return(),
13882 NeverReachable() and Throw() methods to modify the reachability.
13883 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13884 done by FlowBranching.Merge().
13885 (FlowBranching.UsageVector.MergeChild): New method; merges the
13886 merge result into the current vector.
13887 (FlowBranching.Merge): New abstract method to merge a branching.
13889 2003-08-12 Martin Baulig <martin@ximian.com>
13891 * expression.cs (Indirection.CacheTemporaries): Create the
13892 LocalTemporary with the pointer type, not its element type.
13894 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13896 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13897 token was a keyword or not.
13899 Add `error' options where an IDENTIFIER was expected; Provide
13900 CheckToken and CheckIdentifierToken convenience error reporting
13903 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13905 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13906 NameSpaceEntry NameSpaceEntry.
13908 (LookupInterfaceOrClass): Avoid creating a full qualified name
13909 from namespace and name: avoid doing lookups when we know the
13910 namespace is non-existant. Use new Tree.LookupByNamespace which
13911 looks up DeclSpaces based on their namespace, name pair.
13913 * driver.cs: Provide a new `parser verbose' to display the
13914 exception thrown during parsing. This is turned off by default
13915 now, so the output of a failure from mcs is more graceful.
13917 * namespace.cs: Track all the namespaces defined in a hashtable
13920 (IsNamespace): New method
13922 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13924 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13925 we know that we need to concatenate (full typename can never be
13930 * statement.cs: Use a bitfield; Do not initialize to null things
13931 which are done by the constructor by default.
13933 * cs-parser.jay: bug fix, parameter was 4, not 3.
13935 * expression.cs: Just use the property;
13937 * statement.cs: No need for GetVariableInfo method.
13939 2003-08-08 Martin Baulig <martin@ximian.com>
13941 * flowanalysis.cs (FlowReturns): This is now nested in the
13942 `FlowBranching' class.
13943 (MyBitVector): Moved this here from statement.cs.
13944 (FlowBranching.SiblingType): New enum type.
13945 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13947 2003-08-07 Martin Baulig <martin@ximian.com>
13949 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13950 `FlowBranching' class and called `BranchingType'.
13952 2003-08-07 Martin Baulig <martin@ximian.com>
13954 * flowanalysis.cs: Moved all the control flow analysis code into
13957 2003-08-07 Martin Baulig <martin@ximian.com>
13959 * assign.cs (Assign.DoResolve): `target' must either be an
13960 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13963 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13965 * expression.cs (BinaryMethod): This kind of expression is created by the
13966 Binary class if it determines that the operator has to be handled
13969 (BinaryDelegate): This kind of expression is created if we are
13970 dealing with a + or - operator on delegates.
13972 (Binary): remove method, argumetns, and DelegateOperator: when
13973 dealing with methods,
13975 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13977 * statement.cs (Block): use bitfields for the three extra booleans
13978 we had in use. Remove unused topblock parameter.
13980 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13982 * assign.cs: Drop extra unneeded tests.
13984 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13986 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13988 * statement.cs (Foreach): Use VariableStorage instead of
13991 * codegen.cs (VariableStorage): New class used by clients that
13992 require a variable stored: locals or fields for variables that
13993 need to live across yield.
13995 Maybe provide a convenience api for EmitThis+EmitLoad?
13997 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14000 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14002 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14003 RemapParameterLValue): New methods that are used to turn a
14004 precomputed FieldInfo into an expression like this:
14008 The idea is to use this instead of making LocalVariableReference
14009 have more than one meaning.
14011 * cs-parser.jay: Add error production to BASE.
14013 * ecore.cs: Deal with TypeManager.GetField returning null, which
14014 is now a valid return value.
14016 (FieldExprNoAddress): New expression for Fields whose address can
14019 * expression.cs (LocalVariableReference): During the resolve
14020 phases, create new expressions if we are in a remapping context.
14021 Remove code that dealt with remapping here.
14023 (ParameterReference): same.
14025 (ProxyInstance): New expression, like the `This' expression, but
14026 it is born fully resolved. We know what we are doing, so remove
14027 the errors that are targeted to user-provided uses of `this'.
14029 * statement.cs (Foreach): our variable is now stored as an
14030 Expression; During resolution, follow the protocol, dont just
14031 assume it will return this.
14033 2003-08-06 Martin Baulig <martin@ximian.com>
14035 * support.cs (SeekableStreamReader.cs): New public class.
14037 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14038 SeekableStreamReader instead of the normal StreamReader.
14040 2003-08-04 Martin Baulig <martin@ximian.com>
14042 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14043 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14044 deambiguate casts and delegate invocations.
14045 (parenthesized_expression): Use the new tokens to ensure this is
14046 not a cast of method invocation.
14048 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14049 when reading a `)' and Deambiguate_CloseParens () was previously
14052 * expression.cs (ParenthesizedExpression): New class. This is
14053 just used for the CS0075 test.
14054 (Binary.DoResolve): Check for CS0075.
14056 2003-07-29 Ravi Pratap <ravi@ximian.com>
14058 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14059 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14060 reference comparison.
14062 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14063 examine the ReturnType for equality - this is necessary in the
14064 cases of implicit and explicit operators whose signature also
14065 includes the return type.
14067 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14069 * namespace.cs: Cache the result of the namespace computation,
14070 instead of computing it every time.
14072 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14074 * decl.cs: Use a global arraylist that we reuse over invocations
14075 to avoid excesive memory consumption. Reduces memory usage on an
14076 mcs compile by one meg (45 average).
14078 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14079 private, work around that.
14081 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14083 * literal.cs (IntLiteral): Define Zero and One static literals.
14085 * cs-parser.jay (integer_literal): use static literals to reduce
14086 memory usage for the most used literals (0, 1 and -1). 211kb
14087 reduced in memory usage.
14089 Replace all calls to `new ArrayList' with `new
14090 ArrayList(4)' which is a good average number for most allocations,
14091 and also requires only 16 bytes of memory for its buffer by
14094 This reduced MCS memory usage in seven megabytes for the RSS after
14097 2003-07-28 Ravi Pratap <ravi@ximian.com>
14099 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14100 handle params methods the correct way by forming only one
14101 applicable set with params and normal methods in them. Earlier we
14102 were looking at params methods only if we found no normal methods
14103 which was not the correct thing to do.
14105 (Invocation.BetterFunction): Take separate arguments indicating
14106 when candidate and the best method are params methods in their
14109 This fixes bugs #43367 and #46199.
14111 * attribute.cs: Documentation updates.
14113 (CheckAttribute): Rename to CheckAttributeTarget.
14114 (GetValidPlaces): Rename to GetValidTargets.
14116 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14117 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14121 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14123 * codegen.cs: Compute IsGeneric correctly.
14125 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14128 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14129 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14130 regressions, and I was chasing more bugs than I required.
14132 * interface.cs: Use expressions for base type names (like classes
14133 and structs have been doing for a while now), and resolve that.
14134 This patch should probably go into head as well.
14136 This makes it one less user of FindType.
14138 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14140 This compiler can not self host currently. Need to fix that.
14142 * Makefile: compile to `gmcs.exe'
14144 * driver.cs: Turn on v2 by default on gmcs.
14146 * generic.cs (ConstructedType): Does no longer take a container
14147 type argument; That will be taken care of later.
14149 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14150 Use SimpleName to resolve for now, so we can continue the work on
14151 the parser, until we get Type.GetType that understands generics.
14153 (ConstructedType.ToString): Implement
14155 (TypeArguments.Resolve): Resolve the child expressions as types.
14157 * cs-parser.jay: Rename interface_constraints to
14158 type_parameter_constraints
14160 (namespace_or_type_name): Only use constructed types for the basic
14161 construction, we will deal with identifier<...> later.
14163 (type/type_name): No longer call DecomposeQI, as
14164 namespace_or_type_name is always decoded now.
14166 2003-07-22 Ravi Pratap <ravi@ximian.com>
14168 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14169 closely: we eliminate methods in base types when we have an
14170 applicable method in a top-level type.
14172 Please see section 14.5.5.1 for an exact description of what goes
14175 This fixes bug #45127 and a host of other related to corlib compilation.
14177 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14178 array is the method corresponding to the top-level type (this is
14179 because of the changes made to icall.c) so we change this
14182 (MethodGroupExpr.Name): This too.
14184 * typemanager.cs (GetElementType): New method which does the right
14185 thing when compiling corlib.
14187 * everywhere: Make use of the above in the relevant places.
14189 2003-07-22 Martin Baulig <martin@ximian.com>
14191 * cs-parser.jay (invocation_expression): Moved
14192 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14193 `cast_expression', but create a InvocationOrCast which later
14194 resolves to either an Invocation or a Cast.
14196 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14197 method; call this before EmitStatement() to make sure that this
14198 expression can be used as a statement.
14200 * expression.cs (InvocationOrCast): New class; resolves to either
14201 an Invocation or a Cast.
14203 * statement.cs (StatementExpression): Call ResolveStatement() on
14204 the ExpressionStatement before emitting it.
14206 2003-07-21 Martin Baulig <martin@ximian.com>
14208 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14209 `ref' and `out' attributes match; fixes #46220.
14210 (MemberAccess.ResolveMemberAccess): You can't reference a type
14211 through an expression; fixes #33180.
14212 (Indexers.GetIndexersForType): Don't return the indexers from
14213 interfaces the class implements; fixes #46502.
14215 2003-07-21 Martin Baulig <martin@ximian.com>
14217 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14218 CS0661 checks; fixes bug #30442.
14220 2003-07-21 Martin Baulig <martin@ximian.com>
14222 * decl.cs (AdditionResult): Added `Error'.
14224 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14226 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14227 cs0031.cs actually work.
14229 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14231 * cs-parser.jay (namespace_name): do not use
14232 namespace_or_type_name, use qualified_identifier, because
14233 namespace_or_type_name will soon return a composed expression
14234 instead of a string.
14236 (namespace_or_type_name): Instead of returning a string, now this
14237 production returns an expression.
14239 * codegen.cs (EmitContext): Setup IsGeneric property based on
14240 whether our DeclSpace is generic, our the method is generic.
14242 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14243 the method is generic.
14245 * cs-parser.jay (type_arguments, opt_type_argument_list,
14246 type_parameters, type_parameter_list, opt_type_parameter_list,
14247 type_parameter,, opt_type_parameter_constraints_clauses,
14248 type_parameter_constraints_clauses,
14249 type_parameter_constraint_clause, type_parameter_constraint,
14250 interface_constraints): Add new production
14252 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14253 DeclSpace is generic or not.
14255 (DeclSpace.SetParameterInfo): New routine, used to set the
14256 parameter info for a type.
14258 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14259 returns a GenericTypeExpr
14261 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14262 generic, lookup the generic argument.
14264 * attribute.cs: Do not allow TypeParameterExpressions in
14267 * class.cs: Do not allow the Main method to be defined in a
14270 * expression.cs (SizeOf): Do not allow generic types to be used as
14271 arguments to sizeof.
14273 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14274 it: whether a type is generic or not. Only works for types we are
14275 currently building for now.
14277 2003-07-20 Martin Baulig <martin@ximian.com>
14279 * namespace.cs: Fixed that bug which caused a crash when compiling
14280 the debugger's GUI.
14282 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14284 * typemanager.cs (LookupTypeReflection): Never expose types which
14285 are NotPublic, NestedPrivate, NestedAssembly, or
14286 NestedFamANDAssem. We used to return these, and later do a check
14287 that would report a meaningful error, but the problem is that we
14288 would not get the real match, if there was a name override.
14290 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14292 * namespace.cs (Namespace, Name): Do not compute the namespace
14293 name dynamically, compute it in the constructor. This reduced
14294 memory usage by 1697 KB.
14296 * driver.cs: Use --pause to pause at the end.
14298 2003-07-17 Peter Williams <peter@newton.cx>
14300 * Makefile: Change the name of the test target so that it doesn't
14301 conflict with the recursive test target.
14303 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14305 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14306 AddressOf): Do not use EmitThis, that was wrong, use the actual
14309 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14311 * class.cs (MethodData.Define): While checking if a method is an
14312 interface implementation, improve the test: If we are not public
14313 (use new test here: use the computed MethodAttributes directly,
14314 instead of the parsed modifier flags) check if the `implementing'
14315 method comes from an interface or not.
14317 * pending.cs (VerifyPendingMethods): Slightly better error
14320 * makefile: add test target that does the mcs bootstrap.
14322 2003-07-16 Ravi Pratap <ravi@ximian.com>
14324 * interface.cs (Define): Do nothing here since there are no
14325 members to populate etc. Move the attribute emission out of here
14326 since this was just totally the wrong place to put it. Attribute
14327 application happens during the 'Emit' phase, not in the 'Define'
14330 (Emit): Add this method and move the attribute emission here
14332 * rootcontext.cs (EmitCode): Call the Emit method on interface
14335 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14337 * expression.cs (OverloadResolve): Report error only if Location
14338 is not 'Null' which means that there was a probe going on.
14340 2003-07-14 Martin Baulig <martin@ximian.com>
14342 * expression.cs (ConditionalLogicalOperator): New public class to
14343 implement user defined conditional logical operators.
14344 This is section 14.11.2 in the spec and bug #40505.
14346 2003-07-14 Martin Baulig <martin@ximian.com>
14348 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14350 2003-07-14 Martin Baulig <martin@ximian.com>
14352 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14354 * ecore.cs (IVariable.VerifyFixed): New interface method.
14356 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14357 operator, check whether the variable is actually fixed. Fixes bug
14358 #36055. Set a variable definitely assigned when taking its
14359 address as required by the spec.
14361 * statement.cs (LocalInfo.IsFixed): New field.
14362 (LocalInfo.MakePinned): Set `IsFixed' to true.
14364 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14366 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14367 for .ctors, ensure that we only ask for members declared in the
14368 attribute type (BindingFlags.DeclaredOnly).
14372 * expression.cs (Error_WrongNumArguments): Report error 1501
14373 correctly the way CSC does.
14375 2003-07-13 Martin Baulig <martin@ximian.com>
14377 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14378 lookup on the fully qualified name, to make things like "X.X" work
14379 where "X.X" is a fully qualified type name, but we also have a
14380 namespace "X" in the using list. Fixes #41975.
14382 2003-07-13 Martin Baulig <martin@ximian.com>
14384 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14385 function. If we're a CompoundAssign, we need to create an embedded
14386 CompoundAssign, not an embedded Assign.
14387 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14390 2003-07-13 Martin Baulig <martin@ximian.com>
14392 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14393 work to fix bug #46088.
14395 2003-07-13 Ravi Pratap <ravi@ximian.com>
14397 * class.cs (Operator.Emit): Do not emit attributes here - it is
14398 taken care of by the Method class that we delegate too. This takes
14399 care of bug #45876.
14401 2003-07-10 Martin Baulig <martin@ximian.com>
14403 * expression.cs (TypeOfVoid): New class.
14404 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14406 2003-07-10 Martin Baulig <martin@ximian.com>
14408 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14411 2003-07-10 Martin Baulig <martin@ximian.com>
14413 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14414 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14416 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14418 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14420 2003-07-10 Martin Baulig <martin@ximian.com>
14422 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14423 of decimal. Fixes #42850.
14425 NOTE: I also fixed the created byte blob, but this doesn't work on
14426 the MS runtime and csc never produces any byte blobs for decimal
14429 2003-07-10 Martin Baulig <martin@ximian.com>
14431 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14432 structs; fixes #32068.
14433 (Block.AddChildVariableNames): Fixed #44302.
14435 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14437 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14439 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14441 * attribute.cs: And this test is onger needed.
14443 2003-07-08 Martin Baulig <martin@ximian.com>
14445 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14446 inaccessible types. Fixes #36313.
14448 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14450 * namespace.cs (NamespaceEntry): Create implicit entries for all
14451 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14452 implicit entries for N1.N2 and N1.
14454 2003-07-08 Martin Baulig <martin@ximian.com>
14456 Rewrote the handling of namespaces to fix a lot of the issues
14457 wrt. `using' aliases etc.
14459 * namespace.cs (Namespace): Splitted this class into a
14460 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14462 * typemanager.cs (TypeManager.IsNamespace): Removed.
14463 (TypeManager.ComputeNamespaces): Only compute namespaces from
14464 loaded assemblies here, not the namespaces from the assembly we're
14465 currently compiling.
14467 2003-07-08 Martin Baulig <martin@ximian.com>
14469 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14471 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14473 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14476 I thought about the memory savings here, but LookupTypeReflection
14477 is used under already very constrained scenarios. Compiling
14478 corlib or mcs only exposes one hit, so it would not really reduce
14479 any memory consumption.
14481 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14483 * typemanager.cs: fixes bug #45889 by only adding public types from
14484 other assemblies to the list of known types.
14486 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14488 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14489 on the type we resolved.
14491 2003-07-05 Martin Baulig <martin@ximian.com>
14493 * pending.cs (PendingImplementation.ParentImplements): Don't
14494 create the proxy if the parent is abstract.
14496 * class.cs (TypeContainer.DefineIndexers): Process explicit
14497 interface implementations first. Fixes #37714.
14499 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14501 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14502 defined recursively; but since we modify the input parameters
14503 (left is set to `this' temporarily), we reset this value if the
14504 left_is_explicit is false, which gives the original semantics to
14507 * literal.cs (NullPointer): new class used to represent a null
14508 literal in a pointer context.
14510 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14511 type is a pointer, use a NullPointer object instead of a
14512 NullLiteral. Closes 43687
14514 (ExplicitConversion): Convert pointer values using
14515 the conv opcode to the proper type.
14517 * ecore.cs (New): change ValueTypeVariable property into a method,
14518 that returns whether the valuetype is suitable for being used.
14520 * expression.cs (Binary.DoNumericPromotions): Only return if we
14521 the int constant was a valid uint, and we can return both left and
14522 right as uints. If not, we continue processing, to trigger the
14523 type conversion. This fixes 39018.
14525 * statement.cs (Block.EmitMeta): During constant resolution, set
14526 the CurrentBlock property on the emitcontext, so that we resolve
14527 constants propertly.
14529 2003-07-02 Martin Baulig <martin@ximian.com>
14531 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14532 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14534 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14535 than emitting it here.
14537 * statement.cs: Fixed some more flow analysis bugs.
14539 2003-07-02 Martin Baulig <martin@ximian.com>
14541 * class.cs (MethodData.Define): When implementing interface
14542 methods, set Final unless we're Virtual.
14544 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14545 check work for interface methods.
14547 2003-07-01 Martin Baulig <martin@ximian.com>
14549 * ecore.cs (EmitContext.This): Replaced this property with a
14550 GetThis() method which takes a Location argument. This ensures
14551 that we get the correct error location for a CS0188.
14553 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14555 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14556 ImplicitStandardConversion.
14558 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14560 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14562 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14565 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14567 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14570 (MethodData.Define): Turn off initlocals for unsafe methods.
14572 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14574 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14575 complete; Fixes #37521.
14577 * delegate.cs: Use Modifiers.TypeAttr to compute the
14578 TypeAttributes, instead of rolling our own. This makes the flags
14579 correct for the delegates.
14581 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14583 * class.cs (Constructor.Define): Set the private flag for static
14584 constructors as well.
14586 * cs-parser.jay (statement_expression): Set the return value to
14587 null, to avoid a crash when we catch an error.
14589 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14591 * cs-parser.jay: Applied patch from Jackson that adds support for
14592 extern and unsafe modifiers to destructor declarations.
14594 * expression.cs: Report error 21 if the user is trying to index a
14597 * driver.cs: Add an error message, suggested by the bug report.
14599 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14600 if we do not have a ": this ()" constructor initializer. Fixes 45149
14602 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14604 * namespace.cs: Add some information to reduce FAQs.
14606 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14608 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14609 underlying enumeration types. Fixes #43915.
14611 * expression.cs: Treat ushort/short as legal values to be used in
14612 bitwise operations.
14614 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14616 * delegate.cs: transfer custom attributes for paramenters from
14617 the delegate declaration to Invoke and BeginInvoke.
14619 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14621 * attribute.cs: handle custom marshalers and emit marshal info
14624 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14626 * makefile.gnu: Added anonymous.cs to the compiler sources.
14628 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14630 * iterators.cs: Change the name of the proxy class to include two
14633 * cs-parser.jay: Update grammar to include anonymous methods.
14635 * anonymous.cs: new file.
14637 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14639 * class.cs (Field.Define): Add missing test for pointers and
14642 2003-05-27 Ravi Pratap <ravi@ximian.com>
14644 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14645 we use the stobj opcode.
14647 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14648 since it wasn't the correct fix.
14650 It still is puzzling that we are required to use stobj for IntPtr
14651 which seems to be a ValueType.
14653 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14655 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14656 during regular simple name resolution. Now, the trick is that
14657 instead of returning for processing the simplename, we do a
14658 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14659 contextual lookup type). If a match is found, return that, if
14660 not, return for further composition.
14662 This fixes long-standing 30485.
14664 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14665 using the address to initialize an object, do an Stobj instead of
14666 using the regular Stelem.
14668 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14669 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14670 Because if we are a BaseIndexerAccess that value will be true.
14673 * statement.cs (GotoCase.Resolve): Return after reporting an
14674 error, do not attempt to continue.
14676 * expression.cs (PointerArithmetic.Emit): If our operand is a
14677 long, convert our constants to match the operand before
14678 multiplying. Convert to I type before adding. Fixes 43670.
14680 2003-05-14 Ravi Pratap <ravi@ximian.com>
14682 * enum.cs (ImplicitConversionExists) : Rename to
14683 ImplicitEnumConversionExists to remove ambiguity.
14685 * ecore.cs (NullCast): New type of cast expression class which
14686 basically is very similar to EmptyCast with the difference being
14687 it still is a constant since it is used only to cast a null to
14689 (eg. (string) null)
14691 * convert.cs (ImplicitReferenceConversion): When casting a null
14692 literal, we return a NullCast.
14694 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14695 should be around anymore.
14697 The renaming (reported was slightly wrong). Corrections:
14699 ConvertImplicitStandard -> ImplicitConversionStandard
14700 ConvertExplicitStandard -> ExplicitConversionStandard
14702 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14703 before passing them in !
14705 * convert.cs (ImplicitConversionStandard): When comparing for
14706 equal expr and target types, ensure that expr is not a
14709 In general, we must not be checking (expr_type ==
14710 target_type) in the top level conversion methods
14711 (ImplicitConversion, ExplicitConversion etc). This checking is
14712 done in the methods that they delegate to.
14714 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14716 * convert.cs: Move Error_CannotConvertType,
14717 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14718 ImplicitNumericConversion, ImplicitConversionExists,
14719 ImplicitUserConversionExists, StandardConversionExists,
14720 FindMostEncompassedType, FindMostSpecificSource,
14721 FindMostSpecificTarget, ImplicitUserConversion,
14722 ExplicitUserConversion, GetConversionOperators,
14723 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14724 TryImplicitIntConversion, Error_CannotConvertImplicit,
14725 ConvertImplicitRequired, ConvertNumericExplicit,
14726 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14727 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14730 Perform the following renames:
14732 StandardConversionExists -> ImplicitStandardConversionExists
14733 ConvertImplicit -> ImplicitConversion
14734 ConvertImplicitStandard -> ImplicitStandardConversion
14735 TryImplicitIntConversion -> ImplicitIntConversion
14736 ConvertImplicitRequired -> ImplicitConversionRequired
14737 ConvertNumericExplicit -> ExplicitNumericConversion
14738 ConvertReferenceExplicit -> ExplicitReferenceConversion
14739 ConvertExplicit -> ExplicitConversion
14740 ConvertExplicitStandard -> ExplicitStandardConversion
14742 2003-05-19 Martin Baulig <martin@ximian.com>
14744 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14745 (TypeInfo): Added support for structs having structs as fields.
14747 * ecore.cs (FieldExpr): Implement IVariable.
14748 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14749 VariableInfo for the field.
14751 2003-05-18 Martin Baulig <martin@ximian.com>
14753 * expression.cs (This.DoResolve): Report a CS0027 if we're
14754 emitting a field initializer.
14756 2003-05-18 Martin Baulig <martin@ximian.com>
14758 * expression.cs (This.ResolveBase): New public function.
14759 (This.DoResolve): Check for CS0188.
14761 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14764 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14765 `instance_expression' to null if we don't have any non-static
14768 2003-05-18 Martin Baulig <martin@ximian.com>
14770 Reworked the way how local variables and parameters are handled by
14771 the flow analysis code.
14773 * statement.cs (TypeInfo, VariableMap): New public classes.
14774 (VariableInfo): New public class. This is now responsible for
14775 checking whether a variable has been assigned. It is used for
14776 parameters and local variables.
14777 (Block.EmitMeta): Take the InternalParameters as argument; compute
14778 the layout of the flow vectors here.
14779 (Block.LocalMap, Block.ParameterMap): New public properties.
14780 (FlowBranching): The .ctor doesn't get the InternalParameters
14781 anymore since Block.EmitMeta() now computes the layout of the flow
14783 (MyStructInfo): This class is now known as `StructInfo' and nested
14784 in `TypeInfo'; we don't access this directly anymore.
14786 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14787 property and removed IsAssigned(), IsFieldAssigned(),
14788 SetAssigned() and SetFieldAssigned(); we now call them on the
14789 VariableInfo so we don't need to duplicate this code everywhere.
14791 * expression.cs (ParameterReference): Added `Block block' argument
14793 (LocalVariableReference, ParameterReference, This): The new
14794 VariableInfo class is now responsible for all the definite
14797 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14798 IsParameterAssigned, SetParameterAssigned): Removed.
14800 2003-05-18 Martin Baulig <martin@ximian.com>
14802 * typemanager.cs (InitCoreTypes): Try calling
14803 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14804 the 3-args-version. Corlib now also needs our `void_type'.
14805 (GetMethod): Added overloaded version which takes an optional
14806 `bool report_errors' to allow lookups of optional methods.
14808 2003-05-12 Martin Baulig <martin@ximian.com>
14810 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14811 only used for locals and not for parameters.
14813 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14815 * support.cs (InternalParameters.ParameterType): Return the
14816 ExternalType of the parameter.
14818 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14821 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14823 * class.cs (MethodData.Define): Do not set the `newslot' on
14824 interface members, if they are also flagged as "override".
14826 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14827 better code for ++i and i++. This only works for static fields
14828 and local variables.
14830 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14831 want to pull the DeclSpace out of the builder_to_declspace instead
14832 of the TypeBuilder (like in TypeContainer.FindMembers).
14834 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14835 instead of LookupTypeContainer. Fixes the crash on .NET for
14836 looking up interface members.
14838 * const.cs: Create our own emit context during the Definition
14839 stage, so that constants are evaluated in the proper context, when
14840 a recursive definition happens.
14842 2003-05-11 Martin Baulig <martin@ximian.com>
14844 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14845 new block for a switch section.
14846 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14847 the adding/lookup in the switch block. Fixes #39828.
14849 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14851 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14852 functionality: I needed to convert the data after I had performed
14853 the add/sub operation into the operands type size.
14855 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14856 pass the type for the box operation, otherwise the resulting
14857 object would have been of type object.
14859 (BoxedCast): Add constructor to specify the type to box as.
14861 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14863 * iterators.cs: I was reusing the `count' variable inadvertently,
14864 take steps to not allow this to happen.
14866 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14868 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14869 by creating an array at the point where the params starts and
14870 putting all those arguments there, then adjusting the size of the
14873 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14875 * expression.cs (New.AddressOf): Implement interface
14876 IMemoryLocation. This is used when the `new' operator is used in
14877 the context of an invocation to a method on a value type.
14879 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14882 * namespace.cs: Also check the using aliases here.
14884 * driver.cs: Move the test for using validity after the types have
14885 been entered, so we do a single pass that also includes the using
14888 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14889 in the regular case. CreateSiblingForFinally is doing extra
14892 * attribute.cs (GetAttributeArgumentExpression): Store the result
14893 on an out value, and use the return value to indicate failure
14894 instead of using null (which is a valid return for Constant.GetValue).
14896 * statement.cs: Perform the analysis flow for the increment
14897 portion after the statement, because this will be the real flow of
14898 execution. Fixes #42385
14900 * codegen.cs (EmitContext.EmitArgument,
14901 EmitContext.EmitStoreArgument): New helper functions when the
14902 RemapToProxy flag is set.
14904 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14907 Add support for remapping parameters.
14909 * iterators.cs: Propagate parameter values; Store parameter
14910 values in the proxy classes.
14912 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14914 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14915 need a proxy reference; I do not know what I was thinking
14917 * cs-parser.jay (constructor_initializer): catch another error,
14918 and display nice message.
14920 (field_declaration): catch void field declaration
14921 to flag a better error.
14923 * class.cs (MemberBase.CheckBase): Report an error instead of a
14924 warning if a new protected member is declared in a struct.
14925 (Field.Define): catch the error of readonly/volatile.
14927 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14929 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14930 volatile variable is taken
14932 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14934 * statement.cs (Fixed.Resolve): Report an error if we are not in
14937 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14939 * typemanager.cs: reuse the code that handles type clashes for
14940 delegates and enumerations.
14942 * class.cs (Report28): Always report.
14944 * expression.cs (EncodeAsAttribute): Allow nulls here.
14946 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14948 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14949 the functionality for testing whether an expression is valid for
14950 an attribute here. Also handle the case of arrays of elements
14953 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14954 encoding a linear array into an array of objects that are suitable
14955 to be passed to an CustomAttributeBuilder.
14957 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14959 * ecore.cs: (FieldExpr): Handle field remapping here.
14961 * iteratators.cs: Pass the instance variable (if the method is an
14962 instance method) to the constructors, so we can access the field
14963 variables on the class.
14965 TODO: Test this with structs. I think the THIS variable on
14966 structs might have to be a pointer, and not a refenrece
14968 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14970 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14971 local variables to fields in a proxy class.
14973 * iterators.cs (PopulateProxy): Rename our internal fields to
14975 Create a <THIS> field if we are an instance method, so we can
14976 reference our parent container variables.
14977 (MapVariable): Called back from the EmitContext code to enter a
14978 new variable to field mapping into the proxy class (we just create
14982 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14983 for using the remapped locals to fields.
14985 I placed the code here, because that gives the same semantics to
14986 local variables, and only changes the Emit code.
14988 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14989 statements inside iterators.
14990 (VariableInfo): Add a FieldBuilder for the cases when we are
14991 remapping local variables to fields in a proxy class
14993 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14994 current_block != null.
14996 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14997 not cope with strings, as it has been moved to the
14998 TableSwitchEmit. Fixed bug in switch generation.
15000 * expression.cs (New.DoResolve): Provide more context for the user
15001 when reporting an error.
15003 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15006 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15007 check the permissions for it. Note than in a type-resolution
15008 context the check was already present in DeclSpace.ResolveType,
15009 but was missing from the MemberAccess.
15011 (ArrayCreation.CheckIndices): warn if the user has
15012 more nested levels of expressions, but there are no more
15013 dimensions specified. Avoids crash on bug 41906.
15015 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15017 * statement.cs (Block): replace Implicit bool, for a generic
15019 New flag: `Unchecked'. This is used during the EmitMeta phase
15020 (which is out-of-line with the regular Resolve/Emit process for a
15021 statement, as this is done ahead of time, but still gets a chance
15022 to call constant resolve).
15024 (Block.Flags): new enum for adding a new flag.
15026 (Block.EmitMeta): track the state of unchecked.
15028 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15029 to enable constant resolution to work there as well.
15031 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15033 * typemanager.cs (ienumerable_type): Also look up
15034 System.Collections.IEnumerable.
15036 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15038 TODO: Test more than one conditional per method.
15040 * class.cs (Indexer.Define): Report the location where the user is
15041 referencing the unsupported feature.
15043 (MethodData): Overload the use of `conditionals' to
15044 minimize the creation of needless ArrayLists. This saves roughly
15045 212kb on my machine.
15047 (Method): Implement the new IIteratorContainer interface.
15048 (Method.SetYields): Implement the method by setting the ModFlags
15049 to contain METHOD_YIELDS.
15051 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15052 which just got set to null.
15054 * iterators.cs: New file.
15056 (Yield, YieldBreak): New statements.
15058 * statement.cs (Return.Resolve): Flag an error if we are used in
15059 an iterator method.
15061 * codegen.cs (InIterator): New flag set if the code is being
15062 compiled in an iterator method.
15064 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15065 internal modifier, and we just use it to avoid adding extra
15066 fields, as this is seldom used.
15068 * cs-parser.jay: Add yield_statement (yield and yield break).
15070 * driver.cs: New flag -v2 to turn on version 2 features.
15072 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15073 hashtable when v2 is enabled.
15075 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15077 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15078 there is already a namespace defined with this name.
15080 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15081 people upgraded their corlibs.
15083 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15084 always use fully qualified types, no need to use the compiler
15087 (TypeManager.IsNamespace): Use binarysearch.
15089 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15090 AddDelegate): I did not quite use the new IsValid API properly: I
15091 have to pass the short-name and the fullname. I was passing only
15092 the basename instead of the fullname sometimes.
15094 (TypeContainer.DefineType): call NamespaceClash.
15096 * interface.cs (Interface.DefineType): use NamespaceClash before
15099 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15102 * enum.cs: (Enum.DefineType): use NamespaceClash before
15105 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15106 speed increase. First, use the negative_hits cache when we get a
15107 negative. Second, add the type with its full original name
15108 instead of the new . and + encoded name (reflection uses + to
15109 separate type from a nested type). Use LookupTypeReflection
15110 directly which bypasses the type->name hashtable (that we already
15111 know does not contain the type.
15113 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15114 location/container type.
15116 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15118 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15120 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15122 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15123 method is being referenced in the method group from a static
15124 context, and report error 120 if so.
15126 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15129 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15130 is created, we create the A namespace).
15132 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15135 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15137 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15138 invocation to ModuleBuilder.GetType with the same values will
15139 return a new type instance, so we need to cache its return
15142 * expression.cs (Binary.ResolveOperator): Only allow the compare
15143 operators on enums if they are of the same type.
15145 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15146 types of ValueType on their own case. Before we were giving them
15147 the same treatment as objects.
15149 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15150 fullname. Short name is used to compare against container name.
15151 Fullname is used to check against defined namespace names.
15153 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15154 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15156 (Method.CheckBase): Call parent.
15157 (MemberBase.CheckBase): Check for protected members on sealed
15159 (PropertyBase.CheckBase): Call parent.
15160 (Field.Define): Call parent.
15162 * report.cs: Negative error codes are now mapped to 8000 - code,
15163 so that the display is render more nicely.
15165 * typemanager.cs: Do not use try/catch, instead report a regular
15168 (GetPointerType, GetReferenceType): These methods provide
15169 mechanisms to obtain the T* and T& from a T. We had the code
15170 previously scattered around the code base, and it also used
15171 TypeManager.LookupType that would go through plenty of caches.
15172 This one goes directly to the type source.
15174 In some places we did the Type.GetType followed by
15175 ModuleBuilder.GetType, but not in others, so this unifies the
15176 processing as well.
15178 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15179 statements now that we have namespace information.
15181 * typemanager.cs (IsNamespace): New method, returns whether the
15182 string presented is a namespace or not.
15184 (ComputeNamespaces): New public entry point, computes the list of
15185 available namespaces, using the GetNamespaces API call in Mono, or
15186 the slower version in MS.NET.
15188 Now before we start the semantic analysis phase, we have a
15189 complete list of namespaces including everything that the user has
15192 Deleted old code to cache namespaces in .nsc files.
15194 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15196 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15197 class/struct location definition Location for the implicit
15198 constructor location.
15200 (Operator.Define): Use the location of the operator for the
15201 implicit Method definition.
15203 (Constructor.Emit): use the constructor location for the implicit
15204 base initializer constructor.
15206 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15207 and the Expression class now contains two new methods:
15209 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15210 isolate type lookup from the rest of the resolution process.
15212 Since we use Expressions to hold type definitions due to the way
15213 we parse the input we have historically overloaded Resolve to
15214 perform the Type lookups if a special flag is passed. Now this is
15215 eliminated and two methods take their place.
15217 The differences in the two methods between xStep and xTerminal is
15218 that xStep is involved in our current lookup system that uses
15219 SimpleNames to compose a name, while xTerminal is used just to
15220 catch the case where the simplename lookup failed.
15222 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15224 * expression.cs (ResolveMemberAccess): Remove redundant code.
15225 TypeExpr expressions are always born fully resolved.
15227 * interface.cs (PopulateMethod): Do not lookup the types twice.
15228 We were doing it once during SemanticAnalysis and once during
15231 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15232 in local variable type definitions, were being returned as a
15233 SimpleName (we decomposed everything into a string), that is
15234 because primary_expression was being used instead of a type in the
15235 grammar (reduce/reduce conflicts).
15237 The part that was wrong is that we converted the expression into a
15238 string (an oversimplification in one hand, compounded with primary
15239 expressions doing string concatenation).
15245 Would return "A.B.C[]" as a SimpleName. This stopped things like
15246 using clauses from working on this particular context. And a type
15247 was being matched directly against "A.B.C[]".
15249 We now use the correct approach, and allow for ComposedCast to be
15250 part of the unary expression. So the "A.B.C []" become a composed
15251 cast of "A.B.C" (as a nested group of MemberAccess with a
15252 SimpleName at the end) plus the rank composition "[]".
15256 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15258 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15259 for the access level checking.
15261 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15262 `TypeContainer container', because I kept getting confused when I
15263 was debugging this code.
15265 * expression.cs (Indexers): Instead of tracking getters/setters,
15266 we now track them in parallel. We create one arraylist less, but
15267 most importantly it is possible now for the LValue code to find a
15268 matching get for a set.
15270 (IndexerAccess.DoResolveLValue): Update the code.
15271 GetIndexersForType has been modified already to extract all the
15272 indexers from a type. The code assumed it did not.
15274 Also make the code set the correct return type for the indexer.
15275 This was fixed a long time ago for properties, but was missing for
15276 indexers. It used to be void_type.
15278 (Binary.Emit): Test first for doubles instead of
15279 floats, as they are more common.
15281 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15282 when dealing with floats and the <=, >= operators. This fixes bug
15285 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15286 to load the array value by emitting a load on the foreach variable
15287 type. This was incorrect.
15289 We now emit the code to load an element using the the array
15290 variable type, and then we emit the conversion operator.
15294 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15296 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15298 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15300 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15301 test for protection before we test for signatures.
15303 (MethodSignature.ToString): implement.
15305 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15306 to the case where we reduced into a LongConstant.
15308 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15309 depend on whether the information is acurrate, because the
15310 Microsoft runtime will always claim that the array type is public,
15311 regardless of the real state.
15313 If the type is a pointer, another problem happens: the type is
15314 reported as non-public in Microsoft.
15316 In both cases we have to call CheckAccessLevel recursively with
15317 the underlying type as the argument to be tested.
15319 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15321 * assign.cs (Assign.Emit): If we are dealing with a compound
15322 assignment expression, we should use the code path that stores the
15323 intermediate result in a temporary value. This fixes #40903.
15325 *expression.cs (Indirection.ToString): Provide ToString method for
15328 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15330 * class.cs: Null out fields holding references to Block objects so
15331 they can be garbage collected.
15333 * expression.cs (OverloadResolve): Remove unused local.
15335 2003-04-07 Martin Baulig <martin@ximian.com>
15337 * codegen.cs (EmitContext.CurrentFile): New public field.
15338 (EmitContext.Mark): Use the CurrentFile to check whether the
15339 location is in the correct file.
15340 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15342 2003-04-07 Martin Baulig <martin@ximian.com>
15344 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15346 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15347 location. [FIXME: The location argument which gets passed to this
15348 method is sometimes wrong!]
15350 2003-04-07 Nick Drochak <ndrochak@gol.com>
15352 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15354 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15356 * expression.cs (Indirection.EmitAssign): We were using the
15357 temporary, but returning immediately instead of continuing the
15360 2003-04-06 Martin Baulig <martin@ximian.com>
15362 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15363 if it's a nested child, but also deriving from the outer class.
15366 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15367 nested child, but also deriving from the outer class. See
15369 (FilterWithClosure): We may access private members of the outer
15370 class if we're a nested child and deriving from the outer class.
15371 (RealMemberLookup): Only set `closure_private_ok' if the
15372 `original_bf' contained BindingFlags.NonPublic.
15374 2003-04-05 Martin Baulig <martin@ximian.com>
15376 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15377 probe if its a type parameter, and if so, flag an error.
15379 * decl.cs: Move here the SetParameterInfo code from class.cs.
15380 Handle IsGeneric here.
15382 Handle a variety of errors in the parameter info definition.
15384 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15385 type parameters here.
15387 * cs-parser.jay (class_declaration): report errors for parameters
15390 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15392 * generic.cs: New file, contains support code for generics.
15394 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15395 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15397 Update parser for the above removals.
15399 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15400 now taken care of in the parser.
15402 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15404 * class.cs (Event.Define): Do not allow abstract events to have
15407 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15409 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15410 block in event declarations.
15412 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15413 value type, get its address.
15415 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15416 leaving a class on the stack instead of a boolean value (int
15417 0/1). Change the code so we compare against null, and then the
15418 result against zero.
15420 * class.cs (TypeContainer.GetClassBases): We were checking for the
15421 parent class being sealed too late.
15423 * expression.cs (Binary.Emit): For <= and >= when dealing with
15424 floating point values, use cgt.un and clt.un instead of cgt and
15427 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15429 * statement.cs: Apply the same optimization as MS: skip the
15430 GetEnumerator returning an IEnumerator, and use the one returning a
15431 CharEnumerator instead. This allows us to avoid the try-finally block
15434 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15436 * cs-parser.jay: Attributes cannot be applied to
15437 namespaces. Fixes #40473
15439 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15442 (Add*): check if the name is valid using the full name for constants,
15443 fields, properties and events.
15445 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15447 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15448 char constants to be part of the enumeration.
15450 * expression.cs (Conditional.DoResolve): Add support for operator
15451 true. Implements the missing functionality from 14.12
15453 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15454 operator true/false as required by the spec.
15456 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15457 implicit conversion to boolean.
15459 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15460 also one where the type implements `operator true'.
15462 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15463 get an expression that will invoke operator true based on an
15466 (GetConversionOperators): Removed the hack that called op_True
15469 (Expression.ResolveBoolean): Move this from Statement.
15471 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15473 * ecore.cs (FieldExpr): do not allow initialization of initonly
15474 fields on derived classes
15476 2003-03-13 Martin Baulig <martin@ximian.com>
15478 * statement.cs (Block.Emit): Call ig.BeginScope() and
15479 ig.EndScope() when compiling with debugging info; call
15480 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15482 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15484 * expression.cs (Indexers): Do not construct immediately, allow
15485 for new members to be appended as we go. Fixes 38143
15487 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15489 * expression.cs: save/restore context when resolving an unchecked
15492 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15494 * cfold.cs: Catch division by zero in modulus operator during
15497 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15499 * interface.cs (Interface.DefineMembers): Avoid defining members
15502 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15504 * driver.cs: handle the +/- options for -noconfig
15506 * statement.cs (Unckeched.Resolve): Also track the state of
15507 unchecked in the Resolve phase.
15509 2003-02-27 Martin Baulig <martin@ximian.com>
15511 * ecore.cs (Expression.MemberLookup): Don't create a
15512 MethodGroupExpr for something which is not a method. Fixes #38291.
15514 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15516 * class.cs (MemberBase.CheckParameters): Also check that the type
15517 is unmanaged if it is a pointer.
15519 * expression.cs (SizeOf.Resolve): Add location information.
15521 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15522 a managed type is declared.
15524 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15525 parameter modifiers as well. Fixes bug 38606
15527 * class.cs: Very sad. Am backing out the speed up changes
15528 introduced by the ArrayList -> Array in the TypeContainer, as they
15529 were not actually that much faster, and introduced a bug (no error
15530 reports on duplicated methods).
15532 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15533 source first, this will guarantee that we have a valid expression
15534 before calling in lower levels functions that will require a
15535 resolved object. Then use this original_source in the
15536 target.ResolveLValue instead of the original source that was
15539 Another change. Use target.Resolve instead of LValueResolve.
15540 Although we are resolving for LValues, we will let the Assign code
15541 take care of that (it will be called again from Resolve). This
15542 basically allows code like this:
15544 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15545 class Y { void A (X x) { x [0] += o; }
15547 The problem was that the indexer was trying to resolve for
15548 set_Item (idx, object o) and never finding one. The real set_Item
15549 was set_Item (idx, X). By delaying the process we get the right
15554 2003-02-23 Martin Baulig <martin@ximian.com>
15556 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15557 while calling DoEmit ().
15559 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15560 source files; if you use the #line directive inside a method, the
15561 compiler stops emitting line numbers for the debugger until it
15562 reaches the end of the method or another #line directive which
15563 restores the original file.
15565 2003-02-23 Martin Baulig <martin@ximian.com>
15567 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15569 2003-02-23 Martin Baulig <martin@ximian.com>
15571 * statement.cs (Block.AddChildVariableNames): We need to call this
15572 recursively, not just for our immediate children.
15574 2003-02-23 Martin Baulig <martin@ximian.com>
15576 * class.cs (Event.Define): Always make the field private, like csc does.
15578 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15579 actually work, fixes bug #37521.
15581 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15583 * delegate.cs: When creating the various temporary "Parameters"
15584 classes, make sure that we call the ComputeAndDefineParameterTypes
15585 on those new parameters (just like we do with the formal ones), to
15586 allow them to be resolved in the context of the DeclSpace.
15588 This fixes the bug that Dick observed in Bugzilla #38530.
15590 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15592 * expression.cs (ResolveMemberAccess): When resolving a constant,
15593 do not attempt to pull a constant if the value was not able to
15594 generate a valid constant.
15596 * const.cs (LookupConstantValue): Do not report more errors than required.
15598 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15600 * expression.cs: fixes bug #38328.
15602 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15604 * class.cs: Changed all the various members that can be part of a
15605 class from being an ArrayList to be an Array of the right type.
15606 During the DefineType type_list, interface_list, delegate_list and
15607 enum_list are turned into types, interfaces, delegates and enums
15610 And during the member population, indexer_list, event_list,
15611 constant_list, field_list, instance_constructor_list, method_list,
15612 operator_list and property_list are turned into their real arrays.
15614 Although we could probably perform this operation earlier, for
15615 good error reporting we need to keep the lists and remove the
15616 lists for longer than required.
15618 This optimization was triggered by Paolo profiling the compiler
15619 speed on the output of `gen-sample-program.pl' perl script.
15621 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15622 not crash in methods like MemberLookupFailed that use this field.
15624 This problem arises when the compiler fails to resolve a type
15625 during interface type definition for example.
15627 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15629 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15630 inherit from System.Object, so we have to stop at null, not only
15631 when reaching System.Object.
15633 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15635 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15636 DeclaredOnly because the parent indexer might have had a different
15637 name, but did not loop until the top of the hierarchy was reached.
15639 The problem this one fixes is 35492: when a class implemented an
15640 indexer from an interface, we were getting the interface method
15641 (which was abstract) and we were flagging an error (can not invoke
15644 This also keeps bug 33089 functioning, and test-148 functioning.
15646 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15647 out if a method is special is to see if it is declared in a
15648 property or event, or whether it is one of the predefined operator
15649 names. This should fix correctly #36804.
15651 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15653 The goal here is to remove the dependency on EmptyCast.Peel ().
15654 Killing it completely.
15656 The problem is that currently in a number of places where
15657 constants are expected, we have to "probe" for an EmptyCast, and
15658 Peel, which is not the correct thing to do, as this will be
15659 repetitive and will likely lead to errors.
15661 The idea is to remove any EmptyCasts that are used in casts that
15662 can be reduced to constants, so we only have to cope with
15665 This bug hunt was triggered by Bug 37363 and the desire to remove
15666 the duplicate pattern where we were "peeling" emptycasts to check
15667 whether they were constants. Now constants will always be
15670 * ecore.cs: Use an enumconstant here instead of wrapping with
15673 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15674 throwing me off. By handling this we can get rid of a few hacks.
15676 * statement.cs (Switch): Removed Peel() code.
15678 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15680 * class.cs: Location information for error 508
15682 * expression.cs (New.DoResolve): Add a guard against double
15683 resolution of an expression.
15685 The New DoResolve might be called twice when initializing field
15686 expressions (see EmitFieldInitializers, the call to
15687 GetInitializerExpression will perform a resolve on the expression,
15688 and later the assign will trigger another resolution
15690 This leads to bugs (#37014)
15692 * delegate.cs: The signature for EndInvoke should contain any ref
15693 or out parameters as well. We were not doing this in the past.
15695 * class.cs (Field.Define): Do not overwrite the type definition
15696 inside the `volatile' group. Turns out that volatile enumerations
15697 were changing the type here to perform a validity test, which
15700 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15702 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15703 and structs, we do not want to load the instance variable
15705 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15706 enum_type has to be handled like an object reference (implicit
15707 conversions exists from this to object), but the regular IsClass
15708 and IsValueType tests will never return true for this one.
15710 Also we use TypeManager.IsValueType instead of type.IsValueType,
15711 just for consistency with the rest of the code (this is only
15712 needed if we ever use the construct exposed by test-180.cs inside
15713 corlib, which we dont today).
15715 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15717 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15720 2003-02-09 Martin Baulig <martin@ximian.com>
15722 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15723 (Namespace.DefineNamespaces): New static public method; this is
15724 called when we're compiling with debugging to add all namespaces
15725 to the symbol file.
15727 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15728 pass it to the Namespace's .ctor.
15730 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15731 and MethodBase arguments; pass the namespace ID to the symwriter;
15732 pass the MethodBase instead of the token to the symwriter.
15733 (SymbolWriter.DefineNamespace): New method to add a namespace to
15736 2003-02-09 Martin Baulig <martin@ximian.com>
15738 * symbolwriter.cs: New file. This is a wrapper around
15739 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15740 methods here in near future.
15742 2003-02-09 Martin Baulig <martin@ximian.com>
15744 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15745 ILGenerator.MarkSequencePoint() which are actually used by the
15748 2003-02-09 Martin Baulig <martin@ximian.com>
15750 * location.cs (SourceFile): New public sealed class. This
15751 contains the name and an index which is used in the location's token.
15752 (Location): Reserve an appropriate number of bits in the token for
15753 the source file instead of walking over that list, this gives us a
15754 really huge performance improvement when compiling with debugging.
15756 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15757 `SourceFile' argument instead of a string.
15758 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15759 but don't parse/tokenize here, we need to generate the list of all
15760 source files before we do that.
15761 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15764 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15765 instead of a string.
15767 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15770 2003-02-09 Martin Baulig <martin@ximian.com>
15772 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15773 filename on `#line default'.
15775 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15777 * statement.cs: don't clear the pinned var when the fixed statement
15778 returns from the method (fixes bug#37752).
15780 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15782 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15785 2003-02-07 Martin Baulig <martin@ximian.com>
15787 * driver.cs: Removed the `--debug-args' command line argument.
15789 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15790 automatically by the AsssemblyBuilder.
15791 (CodeGen.InitializeSymbolWriter): We don't need to call any
15792 initialization function on the symbol writer anymore. This method
15793 doesn't take any arguments.
15795 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15797 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15798 from referenced assemblies as well.
15800 2003-02-02 Martin Baulig <martin@ximian.com>
15802 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15804 2003-02-02 Martin Baulig <martin@ximian.com>
15806 * class.cs (Constructor.Emit): Open the symbol writer before
15807 emitting the constructor initializer.
15808 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15809 single-stepping through constructor initializers.
15811 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15813 * class.cs: Handle error 549: do not allow virtual methods in
15816 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15818 * decl.cs: Check access levels when resolving types
15820 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15822 * statement.cs: Add parameters and locals set in catch blocks that might
15823 return to set vector
15825 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15827 * class.cs (Operator): Set the SpecialName flags for operators.
15829 * expression.cs (Invocation.DoResolve): Only block calls to
15830 accessors and operators on SpecialName methods.
15832 (Cast.TryReduce): Handle conversions from char constants.
15835 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15837 * statement.cs: small memory and time optimization in FlowBranching.
15839 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15841 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15842 problem that the last fix but in the other sid (Set).
15844 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15845 access when there is no indexer in the hierarchy.
15847 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15849 * class.cs: Combine some if statements.
15851 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15853 * driver.cs: fixed bug #37187.
15855 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15857 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15858 any indexer, it's needed to build a list with all the indexers in the
15859 hierarchy (AllGetters), else we have problems. Fixes #35653.
15861 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15863 * class.cs (MethodData.Define): It is wrong for an interface
15864 implementation to be static in both cases: explicit and implicit.
15865 We were only handling this in one case.
15867 Improve the if situation there to not have negations.
15869 * class.cs (Field.Define): Turns out that we do not need to check
15870 the unsafe bit on field definition, only on usage. Remove the test.
15872 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15874 * driver.cs: use assembly.Location instead of Codebase (the latest
15875 patch made mcs fail when using MS assemblies).
15877 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15879 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15880 get the path to *corlib.dll.
15882 2003-01-21 Nick Drochak <ndrochak@gol.com>
15886 * typemanager.cs: Remove compiler warnings
15888 2003-01-20 Duncan Mak <duncan@ximian.com>
15890 * AssemblyInfo.cs: Bump the version number to 0.19.
15892 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15894 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15896 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15898 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15900 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15902 * cs-parser.jay: Small fix: we were not comparing the constructor
15903 name correctly. Thanks to Zoltan for the initial pointer.
15905 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15907 * cs-tokenizer.cs: Set file name when specified with #line
15909 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15911 * cs-parser.jay: Only perform the constructor checks here if we
15912 are named like the class; This will help provider a better
15913 error. The constructor path is taken when a type definition is
15914 not found, but most likely the user forgot to add the type, so
15915 report that rather than the constructor error.
15917 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15919 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15922 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15924 * cs-parser.jay: Add cleanup call.
15926 2003-01-13 Duncan Mak <duncan@ximian.com>
15928 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15929 consistent with other methods.
15931 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15933 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15935 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15937 * attribute.cs: only set GuidAttr to true when we have a
15940 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15944 * typemanager.cs: fixes to allow mcs compile corlib with the new
15945 Type.IsSubclassOf fix.
15947 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15949 * expression.cs (LocalVariableReference.DoResolve): Classify a
15950 constant as a value, not as a variable. Also, set the type for
15953 * cs-parser.jay (fixed_statement): take a type instead of a
15954 pointer_type, so we can produce a better error message later.
15956 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15959 (For.DoEmit): Make inifinite loops have a
15960 non-conditional branch back.
15962 (Fixed.DoEmit): First populate the pinned variables, then emit the
15963 statement, then clear the variables. Before I was emitting the
15964 code once for each fixed piece.
15967 2003-01-08 Martin Baulig <martin@ximian.com>
15969 * statement.cs (FlowBranching.MergeChild): A break in a
15970 SWITCH_SECTION does not leave a loop. Fixes #36155.
15972 2003-01-08 Martin Baulig <martin@ximian.com>
15974 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15975 lives in the same number space than `param_map'. Fixes #36154.
15977 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15979 * cs-parser.jay (constructor_declaration): Set the
15980 Constructor.ModFlags before probing for it. This makes the
15981 compiler report 514, 515 and 132 (the code was there, but got
15984 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15985 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15986 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15988 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15990 * enum.cs: create the enum static fields using the enum type.
15992 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15994 * class.cs: don't try to create the ParamBuilder for the return
15995 type if it's not needed (and handle it breaking for the ms runtime
15998 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16000 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16002 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16004 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16005 the command. This showed up while compiling the JANET source
16006 code, which used \r as its only newline separator.
16008 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16010 * class.cs (Method.Define): If we are an operator (because it
16011 reuses our code), then set the SpecialName and HideBySig. #36128
16013 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16015 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16016 exception, report error 120 `object reference required'.
16018 * driver.cs: Add --pause option, used during to measure the size
16019 of the process as it goes with --timestamp.
16021 * expression.cs (Invocation.DoResolve): Do not allow methods with
16022 SpecialName to be invoked.
16024 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16026 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16027 number before adding it.
16029 2002-12-21 Ravi Pratap <ravi@ximian.com>
16031 * ecore.cs (StandardImplicitConversion): When in an unsafe
16032 context, we allow conversion between void * to any other pointer
16033 type. This fixes bug #35973.
16035 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16037 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16038 is not thrown when extensionless outputs are used
16040 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16042 * rootcontext.cs: fixed compilation of corlib.
16044 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16046 * attribute.cs (Attributes.Contains): Add new method.
16048 * class.cs (MethodCore.LabelParameters): if the parameter is an
16049 `out' parameter, check that no attribute `[In]' has been passed.
16051 * enum.cs: Handle the `value__' name in an enumeration.
16053 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16055 * decl.cs: Added special case to allow overrides on "protected
16058 2002-12-18 Ravi Pratap <ravi@ximian.com>
16060 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16061 since it makes much more sense.
16063 (Attributes.ctor): Don't require a Location parameter.
16065 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16067 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16068 since we already have that information per attribute.
16070 * everywhere : make appropriate changes.
16072 * class.cs (LabelParameters): Write the code which actually
16073 applies attributes to the return type. We can't do this on the MS
16074 .NET runtime so we flag a warning in the case an exception is
16077 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16079 * const.cs: Handle implicit null conversions here too.
16081 2002-12-17 Ravi Pratap <ravi@ximian.com>
16083 * class.cs (MethodCore.LabelParameters): Remove the extra
16084 Type [] parameter since it is completely unnecessary. Instead
16085 pass in the method's attributes so that we can extract
16086 the "return" attribute.
16088 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16090 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16091 of ignoring it and letting the compile continue.
16093 * typemanager.cs (ChangeType): use an extra argument to return an
16094 error condition instead of throwing an exception.
16096 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16098 * expression.cs (Unary.TryReduce): mimic the code for the regular
16099 code path. Perform an implicit cast in the cases where we can
16100 implicitly convert to one of the integral types, and then reduce
16101 based on that constant. This fixes bug #35483.
16103 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16105 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16107 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16109 * namespace.cs: fixed bug #35489.
16111 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16113 * class.cs: Remove some dead code.
16115 * cs-parser.jay: Estimate the number of methods needed
16116 (RootContext.MethodCount);
16118 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16119 numbers instead of StringBuilders.
16121 * support.cs (PtrHashtable): Add constructor with initial size;
16122 We can now reduce reallocations of the method table.
16124 2002-12-10 Ravi Pratap <ravi@ximian.com>
16126 * attribute.cs (ApplyAttributes): Keep track of the emitted
16127 attributes on a per-target basis. This fixes bug #35413.
16129 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16131 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16132 default to the Windows 1252 encoding.
16134 (UnixParseOption): Support version, thanks to Alp for the missing
16137 * AssemblyInfo.cs: Add nice assembly information.
16139 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16142 * cs-parser.jay: Allow a trailing comma before the close bracked
16143 in the attribute_section production.
16145 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16146 address of the instance was being taken, I will take this out,
16147 because we take the address of the object immediately here.
16149 2002-12-09 Ravi Pratap <ravi@ximian.com>
16151 * typemanager.cs (AreMultipleAllowed): Take care of the most
16152 obvious case where attribute type is not in the current assembly -
16155 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16157 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16158 definitions, instead of doing that afterwards.
16160 Also we use a nice little hack, depending on the constructor, we
16161 know if we are a "composed" name or a simple name. Hence, we
16162 avoid the IndexOf test, and we avoid
16164 * codegen.cs: Add code to assist in a bug reporter to track down
16165 the source of a compiler crash.
16167 2002-12-07 Ravi Pratap <ravi@ximian.com>
16169 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16170 types have been emitted for a given element and flag an error
16171 if something which does not have AllowMultiple set is used more
16174 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16175 attribute types and their corresponding AllowMultiple properties
16177 (AreMultipleAllowed): Check the property for a given type.
16179 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16180 property in the case we have a TypeContainer.
16182 (Attributes.AddAttribute): Detect duplicates and just skip on
16183 adding them. This trivial fix catches a pretty gross error in our
16184 attribute emission - global attributes were being emitted twice!
16186 Bugzilla bug #33187 is now fixed.
16188 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16190 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16191 instead of pp_and).
16193 * expression.cs (Binary.ResolveOperator): I can only use the
16194 Concat (string, string, string) and Concat (string, string,
16195 string, string) if the child is actually a concatenation of
16198 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16200 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16201 context where we need a 2-character lookahead.
16203 * pending.cs (PendingImplementation): Rework so we can keep track
16204 of interface types all the time, and flag those which were
16205 implemented by parents as optional.
16207 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16209 * expression.cs (Binary.ResolveOperator): Use
16210 String.Concat(string,string,string) or
16211 String.Concat(string,string,string,string) when possible.
16213 * typemanager: More helper methods.
16216 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16218 * pending.cs: remove the bogus return from GetMissingInterfaces()
16219 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16221 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16223 * namespace.cs: avoid duplicated 'using xxx' being added to
16224 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16225 when we get more than one 'using' statement for the same namespace.
16226 Report a CS0105 warning for it.
16228 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16230 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16231 of calling getChar/putback, uses internal knowledge of it.
16233 (xtoken): Reorder tokenizer so most common patterns are checked
16234 first. This reduces the compilation time in another 5% (from 8.11s
16235 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16237 The parsing time is 22% of the compilation in mcs, and from that
16238 64% is spent on the tokenization process.
16240 I tried using a binary search for keywords, but this is slower
16241 than the hashtable. Another option would be to do a couple of
16244 * Not use a StringBuilder, instead use an array of chars,
16245 with a set value. Notice that this way we could catch
16246 the 645 error without having to do it *afterwards*.
16248 * We could write a hand-parser to avoid the hashtable
16249 compares altogether.
16251 The identifier consumption process takes 37% of the tokenization
16252 time. Another 15% is spent on is_number. 56% of the time spent
16253 on is_number is spent on Int64.Parse:
16255 * We could probably choose based on the string length to
16256 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16259 Another 3% is spend on wrapping `xtoken' in the `token' function.
16261 Handle 0xa0 as whitespace (#34752)
16263 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16265 * typemanager.cs (IsCLRType): New routine to tell whether a type
16266 is one of the builtin types.
16268 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16269 typecode in more places instead of doing pointer comparissions.
16270 We could leverage some knowledge about the way the typecodes are
16273 New code to cache namespaces in assemblies, it is currently not
16274 invoked, to be used soon.
16276 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16278 * expression.cs (Binary.ResolveOperator): specially handle
16279 strings, and do not perform user-defined operator overloading for
16282 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16284 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16285 internalcall as it is a pretty simple operation; Avoid whenever
16286 possible to call Char.IsLetter.
16288 (consume_identifier): Cut by half the number of
16289 hashtable calls by merging the is_keyword and GetKeyword behavior.
16291 Do not short-circuit, because if we do, we
16292 report errors (ie, #if false && true would produce an invalid
16296 2002-11-24 Martin Baulig <martin@ximian.com>
16298 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16299 check constant ranges and report a CS0221. Fixes #33186.
16301 2002-11-24 Martin Baulig <martin@ximian.com>
16303 * cs-parser.jay: Make this work for uninitialized variable
16304 declarations in the `for' initializer. Fixes #32416.
16306 2002-11-24 Martin Baulig <martin@ximian.com>
16308 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16309 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16311 2002-11-24 Martin Baulig <martin@ximian.com>
16313 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16314 argument; if true, we also check for user-defined conversions.
16315 This is only needed if both arguments are of a user-defined type.
16316 Fixes #30443, added test-175.cs.
16317 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16319 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16321 2002-11-24 Martin Baulig <martin@ximian.com>
16323 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16324 function to get the store opcode.
16325 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16326 only emit the Ldelema if the store opcode is Stobj. You must run
16327 both test-34 and test-167 to test this. Fixes #34529.
16329 2002-11-23 Martin Baulig <martin@ximian.com>
16331 * ecore.cs (Expression.MemberLookup): Added additional
16332 `qualifier_type' argument which is used when we're being called
16333 from MemberAccess.DoResolve() and null if we're called from a
16335 (Expression.MemberLookupFailed): New method to report errors; this
16336 does the CS1540 check and reports the correct error message.
16338 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16339 argument for the CS1540 check and redone the way how we're dealing
16340 with private members. See the comment in the source code for details.
16341 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16342 `closure_start_type' to `closure_qualifier_type' and check whether
16343 it's not null. It was not this filter being broken, it was just
16344 being called with the wrong arguments.
16346 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16347 and pass it the correct `qualifier_type'; this also does the error
16350 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16352 * expression.cs (Invocation.EmitParams): If the we are dealing
16353 with a non-built-in value type, load its address as well.
16355 (ArrayCreation): Use a a pretty constant instead
16356 of the hardcoded value 2. Use 6 instead of 2 for the number of
16357 static initializers.
16359 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16360 because they are not really value types, just glorified integers.
16362 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16364 * ecore.cs: Remove redundant code for enumerations, make them use
16365 the same code path as everything else, fixes the casting issue
16366 with enumerations in Windows.Forms.
16368 * attribute.cs: Do only cast to string if it is a string, the
16369 validation happens later.
16371 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16372 people upgrade their corlibs.
16374 * ecore.cs: Oops, enumerations were not following the entire code path
16376 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16378 * typemanager.cs (FilterWithClosure): Commented out the test for
16379 1540 in typemanager.cs, as it has problems when accessing
16380 protected methods from a parent class (see test-174.cs).
16382 * attribute.cs (Attribute.ValidateGuid): new method.
16383 (Attribute.Resolve): Use above.
16385 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16387 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16389 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16390 handling for enumerations, as we only needed the TypeContainer
16391 functionality to begin with (this is required for the fix below to
16392 work for enums that reference constants in a container class for
16395 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16397 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16398 a valid TypeBuilder to perform lookups on.o
16400 * class.cs (InheritableMemberSignatureCompare): Use true in the
16401 call to GetGetMethod and GetSetMethod, because we are comparing
16402 the signature, and we need to get the methods *even* if they are
16405 (PropertyBase.CheckBase): ditto.
16407 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16408 GotoCase.Resolve): Use Peel on EmpytCasts.
16410 * ecore.cs (EmptyCast): drop child, add Peel method.
16412 2002-11-17 Martin Baulig <martin@ximian.com>
16414 * ecore.cs (EmptyCast.Child): New public property.
16416 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16417 label resolved to an EmptyCast. Fixes #34162.
16418 (GotoCase.Resolve): Likewise.
16419 (Block.EmitMeta): Likewise.
16421 2002-11-17 Martin Baulig <martin@ximian.com>
16423 * expression.cs (Invocation.BetterConversion): Prefer int over
16424 uint; short over ushort; long over ulong for integer literals.
16425 Use ImplicitConversionExists instead of StandardConversionExists
16426 since we also need to check for user-defined implicit conversions.
16427 Fixes #34165. Added test-173.cs.
16429 2002-11-16 Martin Baulig <martin@ximian.com>
16431 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16432 with the `true' and `false' literals. Fixes #33151.
16434 2002-11-16 Martin Baulig <martin@ximian.com>
16436 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16437 October 22nd; don't do the cs1540 check for static members.
16439 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16440 now using our own filter here and doing the cs1540 check again.
16442 2002-11-16 Martin Baulig <martin@ximian.com>
16444 * support.cs (InternalParameters): Don't crash if we don't have
16445 any fixed parameters. Fixes #33532.
16447 2002-11-16 Martin Baulig <martin@ximian.com>
16449 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16450 when looking up static methods to make this work on Windows.
16453 2002-11-16 Martin Baulig <martin@ximian.com>
16455 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16456 a setter rather than using PropertyInfo.CanWrite.
16458 2002-11-15 Nick Drochak <ndrochak@gol.com>
16460 * class.cs: Allow acces to block member by subclasses. Fixes build
16463 2002-11-14 Martin Baulig <martin@ximian.com>
16465 * class.cs (Constructor.Emit): Added the extern/block check.
16468 2002-11-14 Martin Baulig <martin@ximian.com>
16470 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16471 iteration while looking for indexers, this is needed because the
16472 indexer may have a different name in our base classes. Fixed the
16473 error reporting (no indexers at all, not get accessor, no
16474 overloaded match). Fixes bug #33089.
16475 (IndexerAccess.DoResolveLValue): Likewise.
16477 2002-11-14 Martin Baulig <martin@ximian.com>
16479 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16480 indexers. Fixes the first part of bug #33089.
16481 (MethodSignature.InheritableMemberSignatureCompare): Added support
16484 2002-11-13 Ravi Pratap <ravi@ximian.com>
16486 * attribute.cs (Attribute.Resolve): Catch the
16487 NullReferenceException and report it since it isn't supposed to
16490 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16492 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16493 LogicalOr and LogicalAnd that can benefit from recursively
16494 handling EmitBranchable. The code now should be nice for Paolo.
16496 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16498 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16499 the Type lookups, as we perform quite a number of lookups on
16500 non-Types. This can be removed once we can deterministically tell
16501 whether we have a type or a namespace in advance.
16503 But this might require special hacks from our corlib.
16507 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16508 and double which avoids a conversion from an integer to a double.
16510 * expression.cs: tiny optimization, avoid calling IsConstant,
16511 because it effectively performs the lookup twice.
16513 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16515 But a bogus return here to keep the semantics of the old code
16516 until the Mono runtime is fixed.
16518 * pending.cs (GetMissingInterfaces): New method used to remove all
16519 the interfaces that are already implemented by our parent
16520 classes from the list of pending methods.
16522 * interface.cs: Add checks for calls after ResolveTypeExpr.
16524 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16526 * class.cs (Class.Emit): Report warning 67: event not used if the
16527 warning level is beyond 3.
16529 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16530 being a NullLiteral.
16532 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16535 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16536 path that might fail if a type can not be resolved.
16538 * expression.cs (Binary.Emit): Emit unsigned versions of the
16541 * driver.cs: use error 5.
16543 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16545 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16547 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16549 * cs-parser.jay (switch_section): A beautiful patch from Martin
16550 Baulig that fixed 33094.
16552 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16554 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16555 Check whether the base is abstract and report an error if so.
16557 * expression.cs (IndexerAccess.DoResolveLValue,
16558 IndexerAccess.DoResolve): ditto.
16560 (Invocation.DoResolve): ditto.
16562 (Invocation.FullMethodDesc): Improve the report string.
16564 * statement.cs (Block): Eliminate IsVariableDefined as it is
16565 basically just a wrapper for GetVariableInfo.
16567 * ecore.cs (SimpleName): Use new
16569 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16570 type, as we return the actual parameter ref/unref state on a
16573 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16575 * support.cs: Return proper flags REF/OUT fixing the previous
16578 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16579 not used to mean `ref' but `ref or out' in ParameterReference
16581 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16582 full type signature instead of calling TypeManger.CSharpName
16585 * support.cs (InternalParameters.ParameterDesc): Do not compare
16586 directly to the modflags, because REF/OUT will actually be bitsets
16589 * delegate.cs (VerifyMethod): Check also the modifiers.
16591 * cs-tokenizer.cs: Fix bug where floating point values with an
16592 exponent where a sign was missing was ignored.
16594 * driver.cs: Allow multiple assemblies to be specified in a single
16597 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16599 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16600 because identifiers after a parenthesis would end up in this kind
16601 of production, and we needed to desamiguate it for having casts
16604 (UserDefinedType *) xxx
16606 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16608 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16609 we should set on the Bindingflags.NonPublic, but not turn on
16610 private_ok. private_ok controls whether a Private member is
16611 returned (this is chekced on the filter routine), while the
16612 BindingFlags.NonPublic just controls whether private/protected
16613 will be allowed. This fixes the problem part of the problem of
16614 private properties being allowed to be used in derived classes.
16616 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16617 so we can call the children DoResolveLValue method (this will
16618 properly signal errors on lvalue assignments to base properties)
16620 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16621 getter are null, and we have a property info, we know that this
16622 happened because the lookup failed, so we report an error 122 for
16623 protection level violation.
16625 We also silently return if setter and getter are null in the
16626 resolve functions, this condition only happens if we have flagged
16627 the error before. This is the other half of the problem.
16629 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16630 not have accessibility information, that is why we were returning
16631 true in the filter function in typemanager.cs.
16633 To properly report 122 (property is inaccessible because of its
16634 protection level) correctly, we report this error in ResolveAccess
16635 by failing if both the setter and the getter are lacking (ie, the
16638 DoResolve and DoLResolve have been modified to check for both
16639 setter/getter being null and returning silently, the reason being
16640 that I did not want to put the knowledge about this error in upper
16643 int old = Report.Errors;
16644 x = new PropertyExpr (...);
16645 if (old != Report.Errors)
16650 So the property expr is returned, but it is invalid, so the error
16651 will be flagged during the resolve process.
16653 * class.cs: Remove InheritablePropertySignatureCompare from the
16654 class, as we no longer depend on the property signature to compute
16655 whether it is possible to implement a method or not.
16657 The reason is that calling PropertyInfo.GetGetMethod will return
16658 null (in .NET, in Mono it works, and we should change this), in
16659 cases where the Get Method does not exist in that particular
16664 class X { public virtual int A { get { return 1; } } }
16666 class Z : Y { public override int A { get { return 2; } } }
16668 Would fail in Z because the parent (Y) would not have the property
16669 defined. So we avoid this completely now (because the alternative
16670 fix was ugly and slow), and we now depend exclusively on the
16673 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16674 reference method, instead of using the property.
16676 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16677 routines are gone now.
16679 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16680 names, they were incorrectly named.
16682 * cs-tokenizer.cs: Return are more gentle token on failure.
16684 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16685 had an out-of-sync index variable, which caused it to remove from
16686 the list of pending methods the wrong method sometimes.
16688 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16690 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16691 CanWrite, because those refer to this particular instance of the
16692 property, and do not take into account the fact that we can
16693 override single members of a property.
16695 Constructor requires an EmitContext. The resolution process does
16696 not happen here, but we need to compute the accessors before,
16697 because the resolution does not always happen for properties.
16699 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16700 subclass, before we did not update this flag, but we did update
16703 (GetAccessors): Drop this routine, as it did not work in the
16704 presence of partially overwritten set/get methods.
16706 Notice that this broke the cs1540 detection, but that will require
16709 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16713 * driver.cs: issue a warning instead of an error if we don't support
16714 debugging for the platform. Also ignore a couple of errors that may
16715 arise when trying to write the symbols. Undo my previous patch.
16717 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16719 * driver.cs: ignore /debug switch except for Unix platforms.
16721 2002-10-23 Nick Drochak <ndrochak@gol.com>
16723 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16725 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16727 * driver.cs: Do not make mcs-debug conditional, so we do not break
16728 builds that use it.
16730 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16731 review this patch. But basically after all the children variables
16732 have been merged, the value of "Breaks" was not being set to
16733 new_breaks for Switch blocks. I think that it should be set after
16734 it has executed. Currently I set this to the value of new_breaks,
16735 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16736 conservative, but I do not understand this code very well.
16738 I did not break anything in the build, so that is good ;-)
16740 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16742 2002-10-20 Mark Crichton <crichton@gimp.org>
16744 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16746 2002-10-20 Nick Drochak <ndrochak@gol.com>
16748 * cfold.cs: Fixed compile blocker.
16750 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16752 * driver.cs: I was chekcing the key, not the file.
16754 2002-10-19 Ravi Pratap <ravi@ximian.com>
16756 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16757 message that we were generating - we just need to silently return
16760 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16762 * class.cs (Event.Define): Change my previous commit, as this
16763 breaks the debugger. This is a temporary hack, as it seems like
16764 the compiler is generating events incorrectly to begin with.
16766 * expression.cs (Binary.ResolveOperator): Added support for
16767 "U operator - (E x, E y)"
16769 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16772 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16773 init-only variables, but this path did not take into account that
16774 there might be also instance readonly variables. Correct this
16777 This fixes bug 32253
16779 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16782 * driver.cs: Change the extension for modules to `netmodule'
16784 * cs-parser.jay: Improved slightly the location tracking for
16785 the debugger symbols.
16787 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16788 modifiers that were specified instead of the hardcoded value
16789 (FamAndAssem). This was basically ignoring the static modifier,
16790 and others. Fixes 32429.
16792 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16793 fixed a bug in the process (32476)
16795 * expression.cs (ArrayAccess.EmitAssign): Patch from
16796 hwang_rob@yahoo.ca that fixes bug 31834.3
16798 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16800 * driver.cs: Make the module extension .netmodule.
16802 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16804 * driver.cs: Report an error if the resource file is not found
16805 instead of crashing.
16807 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16808 false, like Emit does.
16810 2002-10-16 Nick Drochak <ndrochak@gol.com>
16812 * typemanager.cs: Remove unused private member. Also reported mcs
16813 bug to report this as a warning like csc.
16815 2002-10-15 Martin Baulig <martin@gnome.org>
16817 * statement.cs (Statement.Emit): Made this a virtual method; emits
16818 the line number info and calls DoEmit().
16819 (Statement.DoEmit): New protected abstract method, formerly knows
16820 as Statement.Emit().
16822 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16824 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16826 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16827 have fixed a remaining problem: not every AddXXXX was adding a
16828 fully qualified name.
16830 Now everyone registers a fully qualified name in the DeclSpace as
16831 being defined instead of the partial name.
16833 Downsides: we are slower than we need to be due to the excess
16834 copies and the names being registered this way.
16836 The reason for this is that we currently depend (on the corlib
16837 bootstrap for instance) that types are fully qualified, because
16838 we dump all the types in the namespace, and we should really have
16839 types inserted into the proper namespace, so we can only store the
16840 basenames in the defined_names array.
16842 2002-10-10 Martin Baulig <martin@gnome.org>
16844 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16845 from bug #31834, see the bug report for a testcase which is
16848 2002-10-10 Martin Baulig <martin@gnome.org>
16850 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16851 flow analysis code for this.
16853 * statement.cs (Do, While, For): Tell the flow analysis code about
16855 (FlowBranching.UsageVector): Added support for infinite loops.
16856 (Block.Resolve): Moved the dead code elimination here and use flow
16859 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16861 * class.cs (Field.Define): Catch cycles on struct type
16864 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16865 fields if the fields are static. We only need to check instance
16868 * expression.cs (As.DoResolve): Test for reference type.
16870 * statement.cs (Using.ResolveExpression): Use
16871 ConvertImplicitRequired, not ConvertImplicit which reports an
16873 (Using.ResolveLocalVariableDecls): ditto.
16875 * expression.cs (Binary.ResolveOperator): Report errors in a few
16876 places where we had to.
16878 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16880 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16882 * expression.cs: Use StoreFromPtr instead of extracting the type
16883 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16885 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16886 an enumeration value to a System.Enum, but System.Enum is not a
16887 value type, but an class type, so we need to box.
16889 (Expression.ConvertExplicit): One codepath could return
16890 errors but not flag them. Fix this. Fixes #31853
16892 * parameter.cs (Resolve): Do not allow void as a parameter type.
16894 2002-10-06 Martin Baulig <martin@gnome.org>
16896 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16897 if it's a class type and not a struct. Fixes #31815.
16899 2002-10-06 Martin Baulig <martin@gnome.org>
16901 * statement.cs: Reworked the flow analysis code a bit to make it
16902 usable for dead code elimination.
16904 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16906 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16908 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16910 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16911 to fix the test 165, will investigate deeper.
16913 2002-10-04 Martin Baulig <martin@gnome.org>
16915 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16916 finally blocks actually work.
16917 (Try.Resolve): We don't need to create a sibling for `finally' if
16918 there is no finally block.
16920 2002-10-04 Martin Baulig <martin@gnome.org>
16922 * class.cs (Constructor.Define): The default accessibility for a
16923 non-default constructor is private, not public.
16925 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16927 * class.cs (Constructor): Make AllowedModifiers public, add
16930 * cs-parser.jay: Perform the modifiers test here, as the
16931 constructor for the Constructor class usually receives a zero
16932 because of the way we create it (first we create, later we
16933 customize, and we were never checking the modifiers).
16935 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16936 is a version of LookupTypeReflection that includes the type-name
16937 cache. This can be used as a fast path for functions that know
16938 the fully qualified name and are only calling into *.GetType() to
16939 obtain a composed type.
16941 This is also used by TypeManager.LookupType during its type
16944 (LookupType): We now also track the real type name, as sometimes
16945 we can get a quey for the real type name from things like
16946 ComposedCast. This fixes bug 31422.
16948 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16949 complete type fullname, it does not have to go through the type
16950 resolution system to obtain the composed version of the type (for
16951 obtaining arrays or pointers).
16953 (Conditional.Emit): Use the EmitBoolExpression to
16954 generate nicer code, as requested by Paolo.
16956 (ArrayCreation.CheckIndices): Use the patch from
16957 hwang_rob@yahoo.ca to validate the array initializers.
16959 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16961 * class.cs (ConstructorInitializer.Emit): simplify code by using
16962 Invocation.EmitCall, and at the same time, fix the bugs in calling
16963 parent constructors that took variable arguments.
16965 * ecore.cs (Expression.ConvertNumericExplicit,
16966 Expression.ImplicitNumericConversion): Remove the code that
16967 manually wrapped decimal (InternalTypeConstructor call is now gone
16970 * expression.cs (Cast.TryReduce): Also handle decimal types when
16971 trying to perform a constant fold on the type.
16973 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16975 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16976 that only turned off an error report, and did nothing else.
16978 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16980 * driver.cs: Handle and ignore /fullpaths
16982 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16984 * expression.cs (Binary.ResolveOperator): Catch the case where
16985 DoNumericPromotions returns true,
16987 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16989 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16991 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16994 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16996 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16997 conversion exists, but it is also required that the conversion be
16998 performed. This manifested in "(Type64Enum) 2".
17000 * class.cs (TypeManager.AddMethod): The fix is not to change
17001 AddEnum, because that one was using a fully qualified name (every
17002 DeclSpace derivative does), but to change the AddMethod routine
17003 that was using an un-namespaced name. This now correctly reports
17004 the duplicated name.
17006 Revert patch until I can properly fix it. The issue
17007 is that we have a shared Type space across all namespaces
17008 currently, which is wrong.
17010 Options include making the Namespace a DeclSpace, and merge
17011 current_namespace/current_container in the parser.
17013 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17015 * cs-parser.jay: Improve error reporting when we get a different
17016 kind of expression in local_variable_type and
17017 local_variable_pointer_type.
17019 Propagate this to avoid missleading errors being reported.
17021 * ecore.cs (ImplicitReferenceConversion): treat
17022 TypeManager.value_type as a target just like object_type. As
17027 Is valid, and needs to result in the int 1 being boxed before it
17028 is assigned to the value type v.
17030 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17031 to validate the enumeration name.
17033 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17034 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17035 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17037 * ecore.cs (TryImplicitIntConversion): When doing an
17038 implicit-enumeration-conversion, check if the type is 64-bits and
17039 perform a conversion before passing to EnumConstant.
17041 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17043 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17044 report ambiguous type references. Unlike the MS version, we
17045 report what the ambiguity is. Innovation at work ;-)
17047 (DeclSpace.FindType): Require a location argument to
17048 display when we display an ambiguous error.
17050 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17052 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17054 * expression.cs (EmitDynamicInitializers): Apply patch from
17055 hwang_rob@yahoo.ca that fixes the order in which we emit our
17058 2002-09-21 Martin Baulig <martin@gnome.org>
17060 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17061 delegate takes no arguments.
17063 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17065 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17068 * expression.cs: Extract the underlying type.
17070 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17072 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17074 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17076 * class.cs (TypeContainer.DefineType): We can not use the nice
17077 PackingSize with the size set to 1 DefineType method, because it
17078 will not allow us to define the interfaces that the struct
17081 This completes the fixing of bug 27287
17083 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17084 means also structs. This fixes part of the problem.
17085 (Expresion.ImplicitReferenceConversionExists): ditto.
17087 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17088 error if there were no errors reported during the type lookup
17089 process, to avoid duplicates or redundant errors. Without this
17090 you would get an ambiguous errors plus a type not found. We have
17091 beaten the user enough with the first error.
17093 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17096 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17097 during the resolution process, stop the lookup, this avoids
17098 repeated error reports (same error twice).
17100 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17102 * typemanager.cs (LookupType): Redo the type lookup code to match
17103 the needs of System.Reflection.
17105 The issue is that System.Reflection requires references to nested
17106 types to begin with a "+" sign instead of a dot. So toplevel
17107 types look like: "NameSpace.TopLevelClass", and nested ones look
17108 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17111 2002-09-19 Martin Baulig <martin@gnome.org>
17113 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17114 says that a method always returns or always throws an exception,
17115 don't report the CS0161.
17117 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17118 set `Returns = new_returns'.
17120 2002-09-19 Martin Baulig <martin@gnome.org>
17122 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17123 to an enum constant, check for a CS0176.
17125 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17127 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17128 for operators that must be in pairs and report errors.
17130 * ecore.cs (SimpleName.DoResolveType): During the initial type
17131 resolution process, when we define types recursively, we must
17132 check first for types in our current scope before we perform
17133 lookups in the enclosing scopes.
17135 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17137 (Invocation.VerifyArgumentsCompat): Call
17138 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17139 I thought we were supposed to always call this, but there are a
17140 few places in the code where we dont do it.
17142 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17144 * driver.cs: Add support in -linkres and -resource to specify the
17145 name of the identifier.
17147 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17149 * ecore.cs (StandardConversionExists): Sync with the conversion
17150 code: allow anything-* to void* conversions.
17152 (FindMostSpecificSource): Use an Expression argument
17153 instead of a Type, because we might be handed over a Literal which
17154 gets a few more implicit conversions that plain types do not. So
17155 this information was being lost.
17157 Also, we drop the temporary type-holder expression when not
17160 2002-09-17 Martin Baulig <martin@gnome.org>
17162 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17163 this is an explicit interface implementation.
17165 2002-09-17 Martin Baulig <martin@gnome.org>
17167 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17168 different `IndexerName' attributes.
17170 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17171 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17172 virtual CommonResolve().
17174 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17176 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17177 and convert that to the UnderlyingType.
17179 * statement.cs (Foreach.Resolve): Indexers are just like variables
17180 or PropertyAccesses.
17182 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17183 inside quoted strings, we were not doing this before.
17185 2002-09-16 Martin Baulig <martin@gnome.org>
17187 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17188 resolve it. This is needed for the definite assignment check of the
17189 instance expression, fixes bug #29846.
17190 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17192 2002-09-16 Nick Drochak <ndrochak@gol.com>
17194 * parameter.cs: Fix compile error. Cannot reference static member
17195 from an instance object. Is this an mcs bug?
17197 2002-09-14 Martin Baulig <martin@gnome.org>
17199 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17200 multiple times. Fixes bug #30295, added test-166.cs.
17202 2002-09-14 Martin Baulig <martin@gnome.org>
17204 * statement.cs (Block.Emit): Don't emit unreachable code.
17205 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17206 `break' statements.
17207 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17209 2002-09-14 Martin Baulig <martin@gnome.org>
17211 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17214 2002-09-14 Martin Baulig <martin@gnome.org>
17216 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17217 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17218 be false on the ms runtime.
17220 2002-09-13 Martin Baulig <martin@gnome.org>
17222 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17223 the CS0038 error message.
17225 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17227 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17228 constant inside, return it.
17230 2002-09-12 Martin Baulig <martin@gnome.org>
17232 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17233 implicit conversion can be done between enum types.
17235 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17236 check whether an implicit conversion to the current enum's UnderlyingType
17237 exists and report an error if not.
17239 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17240 without debugging support.
17242 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17243 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17245 2002-09-12 Martin Baulig <martin@gnome.org>
17247 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17249 * ecore.cs (IMemberExpr.DeclaringType): New property.
17250 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17251 nonstatic member of an outer type (CS0038).
17253 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17255 * driver.cs: Activate the using-error detector at warning level
17256 4 (at least for MS-compatible APIs).
17258 * namespace.cs (VerifyUsing): Small buglett fix.
17260 * pending.cs (PendingImplementation): pass the container pointer.
17262 * interface.cs (GetMethods): Allow for recursive definition. Long
17263 term, I would like to move every type to support recursive
17264 definitions, not the current ordering mechanism that we have right
17267 The situation is this: Attributes are handled before interfaces,
17268 so we can apply attributes to interfaces. But some attributes
17269 implement interfaces, we will now handle the simple cases
17270 (recursive definitions will just get an error).
17272 * parameter.cs: Only invalidate types at the end if we fail to
17275 2002-09-09 Martin Baulig <martin@gnome.org>
17277 * ecore.cs (PropertyExpr.Emit): Also check for
17278 TypeManager.system_int_array_get_length so this'll also work when
17279 compiling corlib. Fixes #30003.
17281 2002-09-09 Martin Baulig <martin@gnome.org>
17283 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17284 and throw an exception if we can't get the type's size. Fixed #30040,
17287 2002-09-09 Martin Baulig <martin@gnome.org>
17289 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17291 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17292 context. Fixes bug #30027.
17294 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17295 virtual functions. Fixes bug #30043, added test-164.cs.
17297 2002-09-08 Ravi Pratap <ravi@ximian.com>
17299 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17301 2002-09-08 Nick Drochak <ndrochak@gol.com>
17303 * driver.cs: Use an object to get the windows codepage since it's not a
17306 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17308 * statement.cs (For.Emit): for infinite loops (test == null)
17309 return whether there is a break inside, not always "true".
17311 * namespace.cs (UsingEntry): New struct to hold the name of the
17312 using definition, the location where it is defined, and whether it
17313 has been used in a successful type lookup.
17315 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17320 2002-09-06 Ravi Pratap <ravi@ximian.com>
17322 * attribute.cs : Fix incorrect code which relied on catching
17323 a NullReferenceException to detect a null being passed in
17324 where an object was expected.
17326 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17328 * statement.cs (Try): flag the catch variable as assigned
17330 * expression.cs (Cast): Simplified by using ResolveType instead of
17331 manually resolving.
17333 * statement.cs (Catch): Fix bug by using ResolveType.
17335 2002-09-06 Ravi Pratap <ravi@ximian.com>
17337 * expression.cs (BetterConversion): Special case for when we have
17338 a NullLiteral as the argument and we have to choose between string
17339 and object types - we choose string the way csc does.
17341 * attribute.cs (Attribute.Resolve): Catch the
17342 NullReferenceException and report error #182 since the Mono
17343 runtime no more has the bug and having this exception raised means
17344 we tried to select a constructor which takes an object and is
17347 2002-09-05 Ravi Pratap <ravi@ximian.com>
17349 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17350 message (1502, 1503) when we can't locate a method after overload
17351 resolution. This is much more informative and closes the bug
17354 * interface.cs (PopulateMethod): Return if there are no argument
17355 types. Fixes a NullReferenceException bug.
17357 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17358 expressions too. Previously we were checking only in one place for
17359 positional arguments leaving out named arguments.
17361 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17362 type to the enum type is not allowed. Remove code corresponding to
17365 (ConvertNumericExplicit): Allow explicit conversions from
17366 the underlying type to enum type. This precisely follows the spec
17367 and closes a bug filed by Gonzalo.
17369 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17372 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17374 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17376 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17377 it was important that we stored the right value after the
17378 reduction in `converted'.
17380 2002-09-04 Martin Baulig <martin@gnome.org>
17382 * location.cs (Location.SymbolDocument): Use full pathnames for the
17385 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17387 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17388 of the expression resolve mechanism, because that will catch the
17389 SimpleName error failures.
17391 (Conditional): If we can not resolve the
17392 expression, return, do not crash.
17394 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17397 (location): display token name instead of its number.
17399 2002-08-28 Martin Baulig <martin@gnome.org>
17401 * expression.cs (Binary.ResolveOperator): Don't silently return
17402 but return an error if an operator cannot be applied between two
17405 2002-08-28 Martin Baulig <martin@gnome.org>
17407 * class.cs (Constructor.Define): Set the permission attributes
17408 correctly instead of making all constructors public.
17410 2002-08-28 Martin Baulig <martin@gnome.org>
17412 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17413 for private members before reporting a CS0103; if we find anything,
17416 2002-08-28 Martin Baulig <martin@gnome.org>
17418 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17419 to check whether `closure_start_type == closure_invocation_type',
17420 we also need to check whether `m.DeclaringType == closure_invocation_type'
17421 before bypassing the permission checks. We might be accessing
17422 protected/private members from the base class.
17423 (TypeManager.RealMemberLookup): Only set private_ok if private
17424 members were requested via BindingFlags.NonPublic.
17426 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17428 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17429 MethodGroupExpr.IsExplicitImpl if appropriate.
17430 (Invocation.DoResolve): Don't report the CS0120 for explicit
17431 interface implementations.
17433 2002-08-27 Martin Baulig <martin@gnome.org>
17435 * expression.cs (Invocation.DoResolve): If this is a static
17436 method and we don't have an InstanceExpression, we must report
17439 2002-08-25 Martin Baulig <martin@gnome.org>
17441 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17442 `==' between a valuetype and an object.
17444 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17446 * ecore.cs (TypeExpr): Provide a ToString method.
17448 2002-08-24 Martin Baulig <martin@gnome.org>
17450 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17451 now called proggie.dbg and it's a binary file.
17453 2002-08-23 Martin Baulig <martin@gnome.org>
17455 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17457 2002-08-23 Martin Baulig <martin@gnome.org>
17459 * struct.cs (MyStructInfo.ctor): Make this work with empty
17460 structs; it's not allowed to use foreach() on null.
17462 2002-08-23 Martin Baulig <martin@gnome.org>
17464 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17465 writer the full pathname of the generated assembly.
17467 2002-08-23 Martin Baulig <martin@gnome.org>
17469 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17470 A `finally' block never returns or breaks; improved handling of
17473 2002-08-23 Martin Baulig <martin@gnome.org>
17475 * statement.cs (Throw.Resolve): Allow `throw null'.
17477 2002-08-23 Martin Baulig <martin@gnome.org>
17479 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17480 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17481 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17482 MemberLookup would return a wrong event if this is an explicit
17483 interface implementation and the class has an event with the same
17486 2002-08-23 Martin Baulig <martin@gnome.org>
17488 * statement.cs (Block.AddChildVariableNames): New public method.
17489 (Block.AddChildVariableName): Likewise.
17490 (Block.IsVariableNameUsedInChildBlock): Likewise.
17491 (Block.AddVariable): Check whether a variable name has already
17492 been used in a child block.
17494 * cs-parser.jay (declare_local_variables): Mark all variable names
17495 from the current block as being used in a child block in the
17498 2002-08-23 Martin Baulig <martin@gnome.org>
17500 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17501 find the symbol writer.
17503 * driver.cs: csc also allows the arguments to /define being
17504 separated by commas, not only by semicolons.
17506 2002-08-23 Martin Baulig <martin@gnome.org>
17508 * interface.cs (Interface.GetMembers): Added static check for events.
17510 2002-08-15 Martin Baulig <martin@gnome.org>
17512 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17513 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17515 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17516 why the MethodData.EmitDestructor() change was necessary.
17518 2002-08-20 Martin Baulig <martin@gnome.org>
17520 * class.cs (TypeContainer.FindMembers): Added static check for events.
17522 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17524 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17525 use Type.GetEvents(), not Type.FindMembers().
17527 2002-08-20 Martin Baulig <martin@gnome.org>
17529 * decl.cs (MemberCache): Added a special method cache which will
17530 be used for method-only searched. This ensures that a method
17531 search will return a MethodInfo with the correct ReflectedType for
17534 2002-08-20 Martin Baulig <martin@gnome.org>
17536 * decl.cs (DeclSpace.FindMembers): Made this public.
17538 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17540 * delegate.cs: fixed build on windows.
17541 [FIXME: Filed as bug #29150: MCS must report these errors.]
17543 2002-08-19 Ravi Pratap <ravi@ximian.com>
17545 * ecore.cs (StandardConversionExists): Return a false
17546 if we are trying to convert the void type to anything else
17547 since that is not allowed.
17549 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17550 we flag error 70 in the event an event is trying to be accessed
17551 directly from outside the declaring type.
17553 2002-08-20 Martin Baulig <martin@gnome.org>
17555 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17556 MemberCache from typemanager.cs to decl.cs.
17558 2002-08-19 Martin Baulig <martin@gnome.org>
17560 * class.cs (TypeContainer): Implement IMemberContainer.
17561 (TypeContainer.DefineMembers): Create the MemberCache.
17562 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17563 return public members if BindingFlags.Public was given, check
17564 whether members are static.
17566 2002-08-16 Martin Baulig <martin@gnome.org>
17568 * decl.cs (DeclSpace.Define): Splitted this in Define and
17569 DefineMembers. DefineMembers is called first and initializes the
17572 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17573 DefineMembers() on all our DeclSpaces.
17575 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17576 but call DefineMembers() on all nested interfaces. We call their
17577 Define() in our new Define() function.
17579 * interface.cs (Interface): Implement IMemberContainer.
17580 (Interface.Define): Moved all code except the attribute stuf to
17582 (Interface.DefineMembers): Initialize the member cache.
17584 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17585 need this anymore since we can use MemberCache.FindMembers directly.
17587 2002-08-19 Martin Baulig <martin@gnome.org>
17589 * typemanager.cs (MemberCache): When creating the cache for an
17590 interface type, add all inherited members.
17591 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17592 to `out bool used_cache' and documented it.
17593 (TypeManager.MemberLookup): If we already used the cache in the first
17594 iteration, we don't need to do the interfaces check.
17596 2002-08-19 Martin Baulig <martin@gnome.org>
17598 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17599 here from IMemberFinder and don't implement this interface anymore.
17600 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17602 * typemanager.cs (IMemberFinder): This interface is now only used by
17603 classes which actually support the member cache.
17604 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17605 since we only put DeclSpaces into this Hashtable.
17606 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17607 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17609 2002-08-16 Martin Baulig <martin@gnome.org>
17611 * typemanager.cs (ICachingMemberFinder): Removed.
17612 (IMemberFinder.MemberCache): New property.
17613 (TypeManager.FindMembers): Merged this with RealFindMembers().
17614 This function will never be called from TypeManager.MemberLookup()
17615 so we can't use the cache here, just the IMemberFinder.
17616 (TypeManager.MemberLookup_FindMembers): Check whether the
17617 IMemberFinder has a MemberCache and call the cache's FindMembers
17619 (MemberCache): Rewrote larger parts of this yet another time and
17620 cleaned it up a bit.
17622 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17624 * driver.cs (LoadArgs): Support quoting.
17626 (Usage): Show the CSC-like command line arguments.
17628 Improved a few error messages.
17630 2002-08-15 Martin Baulig <martin@gnome.org>
17632 * typemanager.cs (IMemberContainer.Type): New property.
17633 (IMemberContainer.IsInterface): New property.
17635 The following changes are conditional to BROKEN_RUNTIME, which is
17636 defined at the top of the file.
17638 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17639 class'es members, but add all members from TypeHandle.ObjectType
17640 if we're an interface.
17641 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17642 is the current type.
17643 (MemberCache.CacheEntry.Container): Removed this field.
17644 (TypeHandle.GetMembers): Include inherited members.
17646 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17648 * typemanager.cs: fixed compilation and added a comment on a field that
17651 2002-08-15 Martin Baulig <martin@gnome.org>
17653 * class.cs (ConstructorInitializer.Resolve): In the
17654 Expression.MemberLookup call, use the queried_type as
17657 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17658 declared' attribute, it's always true.
17659 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17660 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17661 temporary wrapper for FindMembers which tells MemberLookup whether
17662 members from the base classes are included in the return value.
17663 This will go away soon.
17664 (TypeManager.MemberLookup): Use this temporary hack here; once the
17665 new MemberCache is completed, we don't need to do the DeclaredOnly
17666 looping here anymore since the MemberCache will take care of this.
17667 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17668 (MemberCache): When creating the MemberCache for a class, get
17669 members from the current class and all its base classes.
17670 (MemberCache.CacheEntry.Container): New field. This is a
17671 temporary hack until the Mono runtime is fixed to distinguish
17672 between ReflectedType and DeclaringType. It allows us to use MCS
17673 with both the MS runtime and the unfixed Mono runtime without
17674 problems and without accecting performance.
17675 (MemberCache.SearchMembers): The DeclaredOnly looping from
17676 TypeManager.MemberLookup is now done here.
17678 2002-08-14 Martin Baulig <martin@gnome.org>
17680 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17681 Type.GetFields on dynamic types but get the fields from the
17682 corresponding TypeContainer.
17683 (MyStructInfo.GetStructInfo): Added check for enum types.
17685 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17686 (MemberList.SyncRoot): Implemented.
17687 (TypeManager.FilterWithClosure): No need to check permissions if
17688 closure_start_type == closure_invocation_type, don't crash if
17689 closure_invocation_type is null.
17691 2002-08-13 Martin Baulig <martin@gnome.org>
17693 Rewrote TypeContainer.FindMembers to use a member cache. This
17694 gives us a speed increase of about 35% for the self-hosting MCS
17695 build and of about 15-20% for the class libs (both on GNU/Linux).
17697 * report.cs (Timer): New class to get enhanced profiling. This
17698 whole class is "TIMER" conditional since it remarkably slows down
17701 * class.cs (MemberList): New class. This is an IList wrapper
17702 which we're now using instead of passing MemberInfo[]'s around to
17703 avoid copying this array unnecessarily.
17704 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17705 (ICachingMemberFinder, IMemberContainer): New interface.
17706 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17707 has already been checked, otherwise use it for the name comparision.
17708 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17709 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17710 if possible. Returns a MemberList, not a MemberInfo [].
17711 (TypeHandle): New class, implements IMemberContainer. We create
17712 one instance of this class per type, it contains a MemberCache
17713 which is used to do the member lookups.
17714 (MemberCache): New class. Each instance of this class contains
17715 all members of a type and a name-based hash table.
17716 (MemberCache.FindMembers): This is our new member lookup
17717 function. First, it looks up all members of the requested name in
17718 the hash table. Then, it walks this list and sorts out all
17719 applicable members and returns them.
17721 2002-08-13 Martin Baulig <martin@gnome.org>
17723 In addition to a nice code cleanup, this gives us a performance
17724 increase of about 1.4% on GNU/Linux - not much, but it's already
17725 half a second for the self-hosting MCS compilation.
17727 * typemanager.cs (IMemberFinder): New interface. It is used by
17728 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17729 Enum, Delegate or Interface.
17730 (TypeManager.finder_to_member_finder): New PtrHashtable.
17731 (TypeManager.finder_to_container): Removed.
17732 (TypeManager.finder_to_delegate): Removed.
17733 (TypeManager.finder_to_interface): Removed.
17734 (TypeManager.finder_to_enum): Removed.
17736 * interface.cs (Interface): Implement IMemberFinder.
17738 * delegate.cs (Delegate): Implement IMemberFinder.
17740 * enum.cs (Enum): Implement IMemberFinder.
17742 * class.cs (TypeContainer): Implement IMemberFinder.
17744 2002-08-12 Martin Baulig <martin@gnome.org>
17746 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17748 2002-08-12 Martin Baulig <martin@gnome.org>
17750 * ecore.cs (ITypeExpression): New interface for expressions which
17752 (TypeExpression): Renamed to TypeLookupExpression.
17753 (Expression.DoResolve): If we're doing a types-only lookup, the
17754 expression must implement the ITypeExpression interface and we
17755 call DoResolveType() on it.
17756 (SimpleName): Implement the new ITypeExpression interface.
17757 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17758 hack, the situation that we're only looking up types can't happen
17759 anymore when this method is called. Moved the type lookup code to
17760 DoResolveType() and call it.
17761 (SimpleName.DoResolveType): This ITypeExpression interface method
17762 is now doing the types-only lookup.
17763 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17764 (ResolveFlags): Added MaskExprClass.
17766 * expression.cs (MemberAccess): Implement the ITypeExpression
17768 (MemberAccess.DoResolve): Added support for a types-only lookup
17769 when we're called via ITypeExpression.DoResolveType().
17770 (ComposedCast): Implement the ITypeExpression interface.
17772 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17773 Expression.Resolve() with ResolveFlags.Type instead.
17775 2002-08-12 Martin Baulig <martin@gnome.org>
17777 * interface.cs (Interface.Define): Apply attributes.
17779 * attribute.cs (Attribute.ApplyAttributes): Added support for
17780 interface attributes.
17782 2002-08-11 Martin Baulig <martin@gnome.org>
17784 * statement.cs (Block.Emit): Only check the "this" variable if we
17785 do not always throw an exception.
17787 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17788 whether the property has a set accessor.
17790 2002-08-11 Martin Baulig <martin@gnome.org>
17792 Added control flow analysis support for structs.
17794 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17795 with control flow analysis turned off.
17796 (IVariable): New interface.
17797 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17798 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17799 (FieldExpr.DoResolve): Resolve the instance expression with flow
17800 analysis turned off and do the definite assignment check after the
17801 resolving when we know what the expression will resolve to.
17803 * expression.cs (LocalVariableReference, ParameterReference):
17804 Implement the new IVariable interface, only call the flow analysis
17805 code if ec.DoFlowAnalysis is true.
17806 (This): Added constructor which takes a Block argument. Implement
17807 the new IVariable interface.
17808 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17809 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17810 This does the definite assignment checks for struct members.
17812 * class.cs (Constructor.Emit): If this is a non-static `struct'
17813 constructor which doesn't have any initializer, call
17814 Block.AddThisVariable() to tell the flow analysis code that all
17815 struct elements must be initialized before control returns from
17818 * statement.cs (MyStructInfo): New public class.
17819 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17820 argument to this indexer. If non-zero, check an individual struct
17821 member, not the whole struct.
17822 (FlowBranching.CheckOutParameters): Check struct members.
17823 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17824 overloaded versions of these methods which take an additional
17825 `int field_idx' argument to check struct members.
17826 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17827 overloaded versions of these methods which take an additional
17828 `string field_name' argument to check struct member.s
17829 (VariableInfo): Implement the IVariable interface.
17830 (VariableInfo.StructInfo): New public property. Returns the
17831 MyStructInfo instance of the variable if it's a struct or null.
17832 (Block.AddThisVariable): New public method. This is called from
17833 Constructor.Emit() for non-static `struct' constructor which do
17834 not have any initializer. It creates a special variable for the
17835 "this" instance variable which will be checked by the flow
17836 analysis code to ensure that all of the struct's fields are
17837 initialized before control returns from the constructor.
17838 (UsageVector): Added support for struct members. If a
17839 variable/parameter is a struct with N members, we reserve a slot
17840 in the usage vector for each member. A struct is considered fully
17841 initialized if either the struct itself (slot 0) or all its
17842 members are initialized.
17844 2002-08-08 Martin Baulig <martin@gnome.org>
17846 * driver.cs (Driver.MainDriver): Only report an error CS5001
17847 if there were no compilation errors.
17849 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17850 `UnsafeContext' property to determine whether the parent is in
17851 unsafe context rather than checking the parent's ModFlags:
17852 classes nested in an unsafe class are unsafe as well.
17854 2002-08-08 Martin Baulig <martin@gnome.org>
17856 * statement.cs (UsageVector.MergeChildren): Distinguish between
17857 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17858 we return. Added test17() and test18() to test-154.cs.
17860 2002-08-08 Martin Baulig <martin@gnome.org>
17862 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17863 Family access, make sure the invoking type isn't a subclass of the
17864 queried type (that'd be a CS1540).
17866 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17867 this method which takes an additional `Type invocation_type'.
17869 * expression.cs (BaseAccess.DoResolve): Use the base type as
17870 invocation and query type.
17871 (MemberAccess.DoResolve): If the lookup failed and we're about to
17872 report a CS0122, try a lookup with the ec.ContainerType - if this
17873 succeeds, we must report a CS1540.
17875 2002-08-08 Martin Baulig <martin@gnome.org>
17877 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17878 (MethodGroupExpr): Implement the IMemberExpr interface.
17880 * expression (MemberAccess.ResolveMemberAccess): No need to have
17881 any special code for MethodGroupExprs anymore, they're now
17884 2002-08-08 Martin Baulig <martin@gnome.org>
17886 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17887 Family, FamANDAssem and FamORAssem permissions.
17888 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17890 2002-08-08 Martin Baulig <martin@gnome.org>
17892 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17893 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17896 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17898 * driver.cs: implemented /resource option to embed managed resources.
17900 2002-08-07 Martin Baulig <martin@gnome.org>
17902 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17903 (FieldBase.HasFieldInitializer): New public property.
17904 (FieldBase.GetInitializerExpression): New public method. Resolves and
17905 returns the field initializer and makes sure it is only resolved once.
17906 (TypeContainer.EmitFieldInitializers): Call
17907 FieldBase.GetInitializerExpression to get the initializer, this ensures
17908 that it isn't resolved multiple times.
17910 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17911 the resolving process (SimpleName/MemberLookup) that we're currently
17912 emitting a field initializer (which must not access any instance members,
17913 this is an error CS0236).
17915 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17916 argument, if the `IsFieldInitializer' flag is set, we must report and
17917 error CS0236 and not an error CS0120.
17919 2002-08-07 Martin Baulig <martin@gnome.org>
17921 * ecore.cs (IMemberExpr): New public interface.
17922 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17923 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17924 if the expression is an IMemberExpr.
17926 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17927 to be null, implicitly default to `this' if we're non-static in
17928 this case. Simplified the code a lot by using the new IMemberExpr
17929 interface. Also fixed bug #28176 here.
17931 2002-08-06 Martin Baulig <martin@gnome.org>
17933 * cs-parser.jay (SimpleLookup): Removed. We need to create
17934 ParameterReferences during semantic analysis so that we can do a
17935 type-only search when resolving Cast, TypeOf and SizeOf.
17936 (block): Pass the `current_local_parameters' to the Block's
17939 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17940 argument to the constructor.
17941 (ConstructorInitializer.Resolve): Create a temporary implicit
17942 block with the parameters.
17944 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17945 references here if we aren't doing a type-only search.
17947 * statement.cs (Block): Added constructor which takes a
17948 `Parameters parameters' argument.
17949 (Block.Parameters): New public property.
17951 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17952 to `Parameters' and made it public readonly.
17954 2002-08-06 Martin Baulig <martin@gnome.org>
17956 * ecore.cs (Expression.Warning): Made this public as well.
17958 * report.cs (Report.Debug): Print the contents of collections.
17960 2002-08-06 Martin Baulig <martin@gnome.org>
17962 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17963 used to tell Resolve() which kinds of expressions it may return.
17964 (Expression.Resolve): Added overloaded version of this method which
17965 takes a `ResolveFlags flags' argument. This can be used to tell
17966 Resolve() which kinds of expressions it may return. Reports a
17968 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17969 ResolveFlags.SimpleName.
17970 (Expression.Error118): Added overloaded version of this method which
17971 takes a `ResolveFlags flags' argument. It uses the flags to determine
17972 which kinds of expressions are allowed.
17974 * expression.cs (Argument.ResolveMethodGroup): New public method.
17975 Resolves an argument, but allows a MethodGroup to be returned.
17976 This is used when invoking a delegate.
17978 * TODO: Updated a bit.
17980 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17982 Fixed compilation with csc.
17984 * ecore.cs: Expression.Error made public. Is this correct? Should
17985 Warning be made public too?
17987 * expression.cs: use ea.Location instead of ea.loc.
17988 [FIXME: Filed as bug #28607: MCS must report these errors.]
17990 2002-08-06 Martin Baulig <martin@gnome.org>
17992 * ecore.cs (Expression.loc): Moved the location here instead of
17993 duplicating it in all derived classes.
17994 (Expression.Location): New public property.
17995 (Expression.Error, Expression.Warning): Made them non-static and
17996 removed the location argument.
17997 (Expression.Warning): Added overloaded version which takes an
17998 `int level' argument.
17999 (Expression.Error118): Make this non-static and removed the
18000 expression and location arguments.
18001 (TypeExpr): Added location argument to the constructor.
18003 * expression.cs (StaticCallExpr): Added location argument to
18005 (Indirection, PointerArithmetic): Likewise.
18006 (CheckedExpr, UnCheckedExpr): Likewise.
18007 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18008 (StringPtr): Likewise.
18011 2002-08-05 Martin Baulig <martin@gnome.org>
18013 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18015 * assign.cs (Assign.DoResolve): Check whether the source
18016 expression is a value or variable.
18018 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18019 while resolving the corresponding blocks.
18021 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18022 an error, don't silently return null.
18024 * statement.cs (Block.AddVariable): Do the error reporting here
18025 and distinguish between CS0128 and CS0136.
18026 (Block.DoResolve): Report all unused labels (warning CS0164).
18027 (LabeledStatement): Pass the location to the constructor.
18028 (LabeledStatement.HasBeenReferenced): New property.
18029 (LabeledStatement.Resolve): Set it to true here.
18031 * statement.cs (Return.Emit): Return success even after reporting
18032 a type mismatch error (CS0126 or CS0127), this is what csc does and
18033 it avoids confusing the users with any consecutive errors.
18035 2002-08-05 Martin Baulig <martin@gnome.org>
18037 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18039 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18041 * expression.cs (MemberAccess.DoResolve): Silently return if an
18042 error has already been reported.
18044 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18045 error has already been reported.
18047 2002-08-05 Martin Baulig <martin@gnome.org>
18049 * statement.cs (UsageVector): Only initialize the `parameters'
18050 vector if we actually have any "out" parameters.
18052 2002-08-05 Martin Baulig <martin@gnome.org>
18054 * expression.cs (Binary.ResolveOperator): When combining delegates,
18055 they must have the same type.
18057 2002-08-05 Martin Baulig <martin@gnome.org>
18059 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18060 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18061 work with the ms runtime and we also don't need it: if we're a
18062 PropertyBuilder and not in the `indexer_arguments' hash, then we
18063 are a property and not an indexer.
18065 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18066 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18067 since the latter one doesn't work with the ms runtime.
18069 2002-08-03 Martin Baulig <martin@gnome.org>
18071 Fixed bugs #27998 and #22735.
18073 * class.cs (Method.IsOperator): New public field.
18074 (Method.CheckBase): Report CS0111 if there's already a method
18075 with the same parameters in the current class. Report CS0508 when
18076 attempting to change the return type of an inherited method.
18077 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18078 and it's not marked abstract or extern.
18079 (PropertyBase): New abstract base class for Property and Indexer.
18080 (PropertyBase.CheckBase): Moved here from Property and made it work
18082 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18083 the same so we can reuse it there.
18084 (Property, Indexer): Derive from PropertyBase.
18085 (MethodSignature.inheritable_property_signature_filter): New delegate
18086 to find properties and indexers.
18088 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18089 argument and improved error reporting.
18091 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18092 EmptyReadOnlyParameters and made it a property.
18094 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18095 version of this method which takes a `PropertyInfo indexer'.
18096 (TypeManager.RegisterIndexer): New method.
18098 * class.cs: Added myself as author of this file :-)
18100 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18102 * class.cs: fixed compilation on windoze.
18104 2002-08-03 Martin Baulig <martin@gnome.org>
18106 * interface.cs (Interface.GetInterfaceBases): Check whether all
18107 base interfaces are at least as accessible than the current one.
18109 * class.cs (TypeContainer.GetClassBases): Check whether base types
18110 are at least as accessible than the current type.
18111 (TypeContainer.AsAccessible): Implemented and made non-static.
18112 (MemberBase.CheckParameters): Report errors if the accessibility
18115 * delegate.cs (Delegate.Delegate): The default visibility is
18116 internal for top-level types and private for nested types.
18117 (Delegate.Define): Report errors if the accessibility checks fail.
18119 * enum.cs (Enum.Enum): The default visibility is internal for
18120 top-level types and private for nested types.
18121 (Enum.DefineType): Compute the correct visibility.
18123 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18124 function which takes a `bool is_toplevel' instead of a TypeContainer.
18126 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18129 2002-08-02 Martin Baulig <martin@gnome.org>
18131 * expression.cs (LocalVariableReferenc): Added constructor which
18132 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18133 (LocalVariableReference.IsReadOnly): New property.
18134 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18135 variable is readonly, use our own readonly flag to do this; you can
18136 use the new constructor to get a writable reference to a read-only
18139 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18140 reference to the local variable.
18142 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18144 * rootcontext.cs (ResolveCore): Also include System.Exception
18146 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18147 we reach an EmptyStatement.
18149 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18152 * expression.cs (Binary.ResolveOperator): Check error result in
18155 use brtrue/brfalse directly and avoid compares to null.
18157 2002-08-02 Martin Baulig <martin@gnome.org>
18159 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18160 Fixes bug #28407, added test-155.cs.
18162 2002-08-01 Martin Baulig <martin@gnome.org>
18164 * class.cs (Event.EmitDefaultMethod): Make this work with static
18165 events. Fixes #28311, added verify-3.cs.
18167 2002-08-01 Martin Baulig <martin@gnome.org>
18169 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18170 `is_disposable' fields.
18171 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18172 `hm.is_disposable' if we're using the collection pattern.
18173 (Foreach.EmitCollectionForeach): Use the correct type for the
18174 enumerator's local variable, only emit the try/finally block if
18175 necessary (fixes #27713).
18177 2002-08-01 Martin Baulig <martin@gnome.org>
18179 * ecore.cs (Expression.report118): Renamed to Error118 and made
18182 * statement.cs (Throw.Resolve): Check whether the expression is of
18183 the correct type (CS0118) and whether the type derives from
18184 System.Exception (CS0155).
18185 (Catch.Resolve): New method. Do the type lookup here and check
18186 whether it derives from System.Exception (CS0155).
18187 (Catch.CatchType, Catch.IsGeneral): New public properties.
18189 * typemanager.cs (TypeManager.exception_type): Added.
18191 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18193 * driver.cs: Updated About function.
18195 2002-07-31 Martin Baulig <martin@gnome.org>
18197 Implemented Control Flow Analysis.
18199 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18200 (EmitContext.CurrentBranching): Added.
18201 (EmitContext.StartFlowBranching): Added.
18202 (EmitContext.EndFlowBranching): Added.
18203 (EmitContext.KillFlowBranching): Added.
18204 (EmitContext.IsVariableAssigned): Added.
18205 (EmitContext.SetVariableAssigned): Added.
18206 (EmitContext.IsParameterAssigned): Added.
18207 (EmitContext.SetParameterAssigned): Added.
18208 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18209 Added control flow analysis stuff here.
18211 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18212 resolve the expression as lvalue.
18213 (LocalVariableReference.DoResolve): Check whether the variable has
18214 already been assigned.
18215 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18216 the parameter as assigned here.
18217 (ParameterReference.DoResolve): Check whether the parameter has already
18219 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18220 expression as lvalue.
18222 * statement.cs (FlowBranching): New class for the flow analysis code.
18223 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18224 (LabeledStatement.IsDefined): New public property.
18225 (LabeledStatement.AddUsageVector): New public method to tell flow
18226 analyis that the label may be reached via a forward jump.
18227 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18229 (VariableInfo.Number): New public field. This is used by flow analysis
18230 to number all locals of a block.
18231 (Block.CountVariables): New public property. This is the number of
18232 local variables in this block (including the locals from all parent
18234 (Block.EmitMeta): Number all the variables.
18236 * statement.cs: Added flow analysis support to all classes.
18238 2002-07-31 Martin Baulig <martin@gnome.org>
18240 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18241 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18242 then use this argument.
18244 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18246 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18247 use this to specify /define options.
18249 2002-07-29 Martin Baulig <martin@gnome.org>
18251 * statement.cs (Fixed): Moved all code that does variable lookups
18252 and resolvings from Emit to Resolve.
18254 * statement.cs (For): Moved all code that does variable lookups
18255 and resolvings from Emit to Resolve.
18257 * statement.cs (Using): Moved all code that does variable lookups
18258 and resolvings from Emit to Resolve.
18260 2002-07-29 Martin Baulig <martin@gnome.org>
18262 * attribute.cs (Attribute.Resolve): Explicitly catch a
18263 System.NullReferenceException when creating the
18264 CustromAttributeBuilder and report a different warning message.
18266 2002-07-29 Martin Baulig <martin@gnome.org>
18268 * support.cs (ParameterData.ParameterName): Added method to
18269 get the name of a parameter.
18271 * typemanager.cs (TypeManager.IsValueType): New public method.
18273 2002-07-29 Martin Baulig <martin@gnome.org>
18275 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18276 is a flag which specifies that it's either ref or out.
18277 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18278 the out parameter to `out Parameter.Modifier mod', also set the
18279 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18281 * support.cs (InternalParameters.ParameterModifier): Distinguish
18282 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18283 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18285 * expression.cs (Argument.GetParameterModifier): Distinguish
18286 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18287 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18289 2002-07-29 Martin Baulig <martin@gnome.org>
18291 * expression.cs (ParameterReference.ParameterReference): Added
18292 `Location loc' argument to the constructor.
18294 * cs-parser.jay: Pass location to ParameterReference.
18296 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18298 * statement.cs (Try): Initialize the location.
18300 * cs-parser.jay: pass location to Try.
18302 * expression.cs (Unary.Reduce): Change the prototype to return
18303 whether a constant fold could be performed or not. The result is
18304 returned in an out parameters. In the case of Indirection and
18305 AddressOf, we want to perform the full tests.
18307 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18309 * statement.cs (Statement.Emit): Flag dead code.
18311 2002-07-27 Andrew Birkett <andy@nobugs.org>
18313 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18315 2002-07-27 Martin Baulig <martin@gnome.org>
18317 * class.cs (MethodData.Define): Put back call to
18318 TypeManager.AddMethod(), accidentally commented this out.
18320 * report.cs (Debug): New public method to print debugging information,
18321 this is `[Conditional ("DEBUG")]'.
18323 2002-07-26 Martin Baulig <martin@gnome.org>
18325 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18326 (switch_statement): Push the current_block to the switch_stack and
18327 pop it again when we're done with the switch.
18328 (switch_section): The new block is a child of the current_block.
18329 Fixes bug #24007, added test-152.cs.
18331 2002-07-27 Martin Baulig <martin@gnome.org>
18333 * expression.cs (Invocation.EmitArguments): When calling a varargs
18334 function with only its fixed arguments, we need to pass an empty
18337 2002-07-27 Martin Baulig <martin@gnome.org>
18339 Mono 0.13 has been released.
18341 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18343 * driver.cs: Rename --resource to --linkres, because that is what
18344 we do currently, we dont support --resource yet.
18346 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18348 2002-07-25 Martin Baulig <martin@gnome.org>
18350 * class.cs (MethodData): New public class. This is a `method builder'
18351 class for a method or one accessor of a Property/Indexer/Event.
18352 (MethodData.GetMethodFlags): Moved here from MemberBase.
18353 (MethodData.ApplyAttributes): Likewise.
18354 (MethodData.ApplyObsoleteAttribute): Likewise.
18355 (MethodData.ApplyConditionalAttribute): Likewise.
18356 (MethodData.ApplyDllImportAttribute): Likewise.
18357 (MethodData.CheckAbstractAndExternal): Likewise.
18358 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18359 (MethodData.Emit): Formerly known as Method.Emit().
18360 (MemberBase): Moved everything which was specific to a single
18361 accessor/method to MethodData.
18362 (Method): Create a new MethodData and call Define() and Emit() on it.
18363 (Property, Indexer, Event): Create a new MethodData objects for each
18364 accessor and call Define() and Emit() on them.
18366 2002-07-25 Martin Baulig <martin@gnome.org>
18368 Made MethodCore derive from MemberBase to reuse the code from there.
18369 MemberBase now also checks for attributes.
18371 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18372 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18374 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18375 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18376 (MemberBase.ApplyAttributes): New virtual method; applies the
18377 attributes to a method or accessor.
18378 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18379 (MemberBase.ApplyConditionalAttribute): Likewise.
18380 (MemberBase.ApplyDllImportAttribute): Likewise.
18381 (MemberBase.CheckAbstractAndExternal): Likewise.
18382 (MethodCore.ParameterTypes): This is now a property instead of a
18383 method, it's initialized from DoDefineParameters().
18384 (MethodCore.ParameterInfo): Removed the set accessor.
18385 (MethodCore.DoDefineParameters): New protected virtual method to
18386 initialize ParameterTypes and ParameterInfo.
18387 (Method.GetReturnType): We can now simply return the MemberType.
18388 (Method.GetMethodFlags): Override the MemberBase version and add
18389 the conditional flags.
18390 (Method.CheckBase): Moved some code from Define() here, call
18391 DoDefineParameters() here.
18392 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18393 here to avoid some larger code duplication.
18394 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18395 ensure that abstract and external accessors don't declare a body.
18397 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18398 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18399 lookup in the attribute's parent classes, so we need to abort as soon
18400 as we found the first match.
18401 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18402 the attribute has no arguments.
18404 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18407 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18409 * cs-parser.jay: reverted previous patch.
18411 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18413 * cs-parser.jay: fixed bug #22119.
18415 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18417 * attribute.cs: fixed compilation. The error was:
18418 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18419 be assigned to before control leaves the current method."
18420 [FIXME: Filed as bug #28186: MCS must report this error.]
18422 2002-07-25 Martin Baulig <martin@gnome.org>
18424 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18425 method to pull the condition name ouf of a Conditional attribute.
18426 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18427 the obsolete message and error flag out of an Obsolete attribute.
18429 * class.cs (Method.GetMethodFlags): New public method to get the
18430 TypeManager.MethodFlags for this method.
18431 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18433 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18434 if we're overriding a virtual function, set the new private variable
18435 `parent_method'; call the new TypeManager.AddMethod().
18437 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18438 the MethodBuilder and the Method in a PtrHashtable.
18439 (TypeManager.builder_to_method): Added for this purpose.
18440 (TypeManager.MethodFlags): Added IsObsoleteError.
18441 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18442 Obsolete and Conditional arguments in MethodBuilders. If we discover
18443 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18444 the message from the attribute.
18446 2002-07-24 Martin Baulig <martin@gnome.org>
18448 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18449 preprocessor directives, ensure that the argument to #define/#undef is
18450 exactly one identifier and that it's actually an identifier.
18452 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18455 2002-07-24 Martin Baulig <martin@gnome.org>
18457 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18458 initialize it to TypeManager.object_type in the constructor.
18459 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18460 of the `hm.get_current' method if we're using the collection pattern.
18461 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18462 for the explicit conversion to make it work when we're using the collection
18463 pattern and the `Current' property has a different return type than `object'.
18466 2002-07-24 Martin Baulig <martin@gnome.org>
18468 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18469 does not match, but don't report any errors. This method is called in
18470 order for all methods in a MethodGroupExpr until a matching method is
18471 found, so we don't want to bail out if the first method doesn't match.
18472 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18473 matches, report the 123. Fixes #28070.
18475 2002-07-24 Martin Baulig <martin@gnome.org>
18477 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18478 TypeManager.TypeToCoreType() to the top of the method so the
18479 following equality checks will work. Fixes #28107.
18481 2002-07-24 Martin Baulig <martin@gnome.org>
18483 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18484 operand is of type uint, and the other operand is of type sbyte,
18485 short or int, the operands are converted to type long." -
18486 Actually do what this comment already told us. Fixes bug #28106,
18489 2002-07-24 Martin Baulig <martin@gnome.org>
18491 * class.cs (MethodBase): New abstract class. This is now a base
18492 class for Property, Indexer and Event to avoid some code duplication
18493 in their Define() and DefineMethods() methods.
18494 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18495 generic methods for Define() and DefineMethods().
18496 (FieldBase): Derive from MemberBase, not MemberCore.
18497 (Property): Derive from MemberBase, not MemberCore.
18498 (Property.DefineMethod): Moved all the code from this method to the
18499 new MethodBase.DefineAccessor(), just call it with appropriate
18501 (Property.Define): Call the new Property.DoDefine(), this does some
18502 sanity checks and we don't need to duplicate the code everywhere.
18503 (Event): Derive from MemberBase, not MemberCore.
18504 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18505 accessors, this will also make them work with interface events.
18506 (Indexer): Derive from MemberBase, not MemberCore.
18507 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18508 (Indexer.Define): Use the new MethodBase functions.
18510 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18511 argument to the constructor.
18512 (Interface.FindMembers): Added support for interface events.
18513 (Interface.PopluateEvent): Implemented.
18515 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18517 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18519 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18520 but this is required to check for a method name being the same as
18521 the containing class.
18525 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18527 * interface.cs: initialize variable.
18529 2002-07-23 Martin Baulig <martin@gnome.org>
18531 Implemented the IndexerName attribute in interfaces.
18533 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18534 name if this is an explicit interface implementation.
18535 (Indexer.InterfaceIndexerName): New public variable. If we're
18536 implementing an interface indexer, this is the IndexerName in that
18537 interface. Otherwise, it's the IndexerName.
18538 (Indexer.DefineMethod): If we're implementing interface indexer,
18539 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18540 and Pending.ImplementIndexer methods.
18541 (Indexer.Define): Also define the PropertyBuilder if we're
18542 implementing an interface indexer and this is neither an explicit
18543 interface implementation nor do the IndexerName match the one in
18546 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18547 If a method is defined here, then we always need to create a proxy
18548 for it. This is used when implementing interface indexers.
18549 (Pending.IsInterfaceIndexer): New public method.
18550 (Pending.ImplementIndexer): New public method.
18551 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18552 This is used when implementing interface indexers to define a proxy
18554 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18555 define a proxy if necessary.
18557 * interface.cs (Interface.IndexerName): New public variable.
18558 (Interface.PopulateIndexer): Set the IndexerName.
18559 (Interface.DefineIndexers): New private method. Populate all the
18560 indexers and make sure their IndexerNames match.
18562 * typemanager.cs (IndexerPropertyName): Added support for interface
18565 2002-07-22 Martin Baulig <martin@gnome.org>
18567 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18568 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18569 ret if HasReturnLabel.
18570 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18573 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18574 and set the ec.LoopBeginTryCatchLevel.
18575 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18576 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18577 the current ec.TryCatchLevel, the branch goes out of an exception
18578 block. In this case, we need to use Leave and not Br.
18580 2002-07-22 Martin Baulig <martin@gnome.org>
18582 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18583 block unless the block does not always return or it is contained in
18584 another try { ... } catch { ... } block. Fixes bug #26506.
18585 Added verify-1.cs to the test suite.
18587 2002-07-22 Martin Baulig <martin@gnome.org>
18589 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18590 then we do not always return. Fixes bug #24985.
18592 2002-07-22 Martin Baulig <martin@gnome.org>
18594 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18595 lookup on a per-class level; ie. walk up the class hierarchy until we
18596 found at least one applicable method, then choose the best among them.
18597 Fixes bug #24463 and test-29.cs.
18599 2002-07-22 Martin Baulig <martin@gnome.org>
18601 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18602 return types of the methods. The return type is not part of the
18603 signature and we must not check it to make the `new' modifier work.
18604 Fixes bug #27999, also added test-147.cs.
18605 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18607 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18608 on the method's return type.
18610 2002-07-21 Martin Baulig <martin@gnome.org>
18612 * assign.cs: Make this work if the rightmost source is a constant and
18613 we need to do an implicit type conversion. Also adding a few more tests
18614 to test-38.cs which should have caught this.
18616 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18617 target in the makefile for this. The makefile.gnu is primarily intended
18618 for end-users who don't want to debug the compiler.
18620 2002-07-21 Martin Baulig <martin@gnome.org>
18622 * assign.cs: Improved the Assign class so it can now handle embedded
18623 assignments (X = Y = Z = something). As a side-effect this'll now also
18624 consume less local variables. test-38.cs now passes with MCS, added
18625 a few new test cases to that test.
18627 2002-07-20 Martin Baulig <martin@gnome.org>
18629 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18630 instructions. Fixes bug #27977, also added test-146.cs.
18632 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18634 * cs-tokenizer.cs: fixed getHex ().
18636 2002-07-19 Martin Baulig <martin@gnome.org>
18638 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18639 not Type.GetType() to lookup the array type. This is needed when
18640 we're constructing an array of a user-defined type.
18641 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18642 single-dimensional arrays, but also for single-dimensial arrays of
18645 2002-07-19 Martin Baulig <martin@gnome.org>
18647 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18648 this function is called, it's not allowed to share LocalBuilders
18649 among ILGenerators.
18651 2002-07-19 Martin Baulig <martin@gnome.org>
18653 * expression.cs (Argument.Resolve): Report an error 118 when trying
18654 to pass a type as argument.
18656 2002-07-18 Martin Baulig <martin@gnome.org>
18658 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18659 Conv_R_Un for the signed `long' type.
18661 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18663 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18664 `expr' for the temporary result, as that will fail if we do
18665 multiple resolves on the same expression.
18667 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18669 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18670 ec.TypeContainer for looking up aliases.
18672 * class.cs (TypeContainer): Remove LookupAlias from here.
18674 * decl.cs (DeclSpace); Move here.
18676 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18678 * class.cs (FindMembers): Only call filter if the constructor
18679 bulider is not null.
18681 Also handle delegates in `NestedTypes' now. Now we will perform
18682 type lookups using the standard resolution process. This also
18685 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18686 This uses Expressions (the limited kind that can be parsed by the
18687 tree) instead of strings.
18689 * expression.cs (ComposedCast.ToString): Implement, used to flag
18690 errors since now we have to render expressions.
18692 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18695 * ecore.cs (SimpleName.ToString): ditto.
18697 * cs-parser.jay: Instead of using strings to assemble types, use
18698 Expressions to assemble the type (using SimpleName, ComposedCast,
18699 MemberAccess). This should fix the type lookups in declarations,
18700 because we were using a different code path for this.
18702 * statement.cs (Block.Resolve): Continue processing statements
18703 even when there is an error.
18705 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18707 * class.cs (Event.Define): Also remove the `remove' method from
18708 the list of pending items.
18710 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18711 generate more compact code.
18713 2002-07-17 Martin Baulig <martin@gnome.org>
18715 * const.cs (Const.LookupConstantValue): Add support for constant
18716 `unchecked' and `checked' expressions.
18717 Also adding test case test-140.cs for this.
18719 2002-07-17 Martin Baulig <martin@gnome.org>
18721 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18722 check whether mi.ReturnType implements the IEnumerator interface; the
18723 `==' and the IsAssignableFrom() will fail in this situation.
18725 2002-07-16 Ravi Pratap <ravi@ximian.com>
18727 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18730 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18732 * expression.cs: fixed bug #27811.
18734 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18736 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18737 Molaro: when we are a ref, the value already contains a pointer
18738 value, do not take the address of it.
18740 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18741 * removed mb-parser.jay and mb-tokenizer.cs
18743 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18745 * expression.cs: check against the building corlib void type.
18747 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18749 * ecore.cs: fix for valuetype static readonly fields: when
18750 initializing them, we need their address, not the address of a copy.
18752 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18754 * typemanager.cs: register also enum_type in corlib.
18756 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18758 * class.cs: allow calling this (but not base) initializers in structs.
18760 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18762 * ecore.cs: make sure we compare against the building base types
18765 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18767 * typemanager.cs: fix TypeToCoreType() to handle void and object
18768 (corlib gets no more typerefs after this change).
18770 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18772 * expression.cs (ArrayCreation.EmitArrayArguments): use
18773 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18775 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18776 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18777 array indexes, the runtime actually forbids them.
18779 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18780 for array arguments here.
18782 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18783 instead of the default for ValueTypes.
18785 (New.DoEmit): Use IsValueType instead of
18786 IsSubclassOf (value_type)
18787 (New.DoResolve): ditto.
18788 (Invocation.EmitCall): ditto.
18790 * assign.cs (Assign): ditto.
18792 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18793 Statements *are* currently doing part of their resolution during
18796 Expressions do always resolve during resolve, but statements are
18797 only required to propagate resolution to their children.
18799 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18801 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18803 (LoadAssembly): Do not add the dll if it is already specified
18805 (MainDriver): Add the System directory to the link path at the end,
18806 after all the other -L arguments.
18808 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18809 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18810 ldelem.u1) and using the opposite for sbytes.
18812 This fixes Digger, and we can finally run it.
18814 * driver.cs (UnixParseOption): Move the option parsing here.
18815 (CSCParseOption): Implement CSC-like parsing of options.
18817 We now support both modes of operation, the old Unix way, and the
18818 new CSC-like way. This should help those who wanted to make cross
18819 platform makefiles.
18821 The only thing broken is that /r:, /reference: and /lib: are not
18822 implemented, because I want to make those have the same semantics
18823 as the CSC compiler has, and kill once and for all the confussion
18824 around this. Will be doing this tomorrow.
18826 * statement.cs (Unsafe.Resolve): The state is checked during
18827 resolve, not emit, so we have to set the flags for IsUnsfe here.
18829 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18831 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18832 not catch the Error_ObjectRefRequired in SimpleName (as it is
18833 possible to have a class/instance variable name that later gets
18834 deambiguated), we have to check this here.
18836 2002-07-10 Ravi Pratap <ravi@ximian.com>
18838 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18839 make static and put into Expression.
18841 (Event.Define): Register the private field of the event with the
18842 TypeManager so that GetFieldFromEvent can get at it.
18844 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18845 keep track of the private field associated with an event which
18848 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18851 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18853 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18855 * expression.cs (Binary.EmitBranchable): this routine emits the
18856 Binary expression in a branchable context. This basically means:
18857 we need to branch somewhere, not just get the value on the stack.
18859 This works together with Statement.EmitBoolExpression.
18861 * statement.cs (Statement.EmitBoolExpression): Use
18864 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18866 * statement.cs (For): Reduce the number of jumps in loops.
18868 (For): Implement loop inversion for the For statement.
18870 (Break): We can be breaking out of a Try/Catch controlled section
18871 (foreach might have an implicit try/catch clause), so we need to
18872 use Leave instead of Br.
18874 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18875 now). If the instace expression supports IMemoryLocation, we use
18876 the AddressOf method from the IMemoryLocation to extract the
18877 address instead of emitting the instance.
18879 This showed up with `This', as we were emitting the instance
18880 always (Emit) instead of the Address of This. Particularly
18881 interesting when This is a value type, as we dont want the Emit
18882 effect (which was to load the object).
18884 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18886 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18888 * statement.cs (Checked): Set the CheckedState during the resolve
18889 process too, as the ConvCast operations track the checked state on
18890 the resolve process, and not emit.
18892 * cs-parser.jay (namespace_member_declaration): Flag that we have
18893 found a declaration when we do. This is used to flag error 1529
18895 * driver.cs: Report ok when we display the help only.
18897 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18899 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18901 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18903 * cs-tokenizer.cs (define): We also have to track locally the
18904 defines. AllDefines is just used for the Conditional Attribute,
18905 but we also need the local defines for the current source code.
18907 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18909 * statement.cs (While, For, Do): These loops can exit through a
18910 Break statement, use this information to tell whether the
18911 statement is the last piece of code.
18913 (Break): Flag that we break.
18915 * codegen.cs (EmitContexts): New `Breaks' state variable.
18917 2002-07-03 Martin Baulig <martin@gnome.org>
18919 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18920 modifiers in method declarations in structs. Otherwise, you won't
18921 be able to override things like Object.Equals().
18923 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18925 * class.cs (Method, Property, Indexer): Do not allow the public
18926 modifier to be used in explicit interface implementations.
18928 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18929 override modifiers in method declarations in structs
18931 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18933 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18934 integer or real overflow, report an error
18936 2002-07-02 Martin Baulig <martin@gnome.org>
18938 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18939 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18940 to tell the runtime about our newly created System.Object and
18941 System.ValueType types.
18943 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18945 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18946 struct instead of Ldarg/Starg.
18948 2002-07-02 Martin Baulig <martin@gnome.org>
18950 * expression.cs (Indirection.Indirection): Call
18951 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18953 2002-07-02 Martin Baulig <martin@gnome.org>
18955 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18956 ValueType, call TypeManager.TypeToCoreType() on it.
18957 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18958 the OpCodes.Newarr argument.
18960 2002-07-02 Martin Baulig <martin@gnome.org>
18962 * expression.cs (Invocation.EmitCall): When compiling corlib,
18963 replace all calls to the system's System.Array type to calls to
18964 the newly created one.
18966 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18967 System.Array methods.
18968 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18969 from the system's System.Array type which must be replaced.
18971 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18973 * typemanager.cs: load unverifiable_code_ctor so we can build
18974 corlib using the correct type. Avoid using GetTypeCode() with
18976 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18977 TypeManager.object_type to allow building corlib.
18979 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18981 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18983 2002-07-01 Martin Baulig <martin@gnome.org>
18985 * class.cs: Make the last change actually work, we need to check
18986 whether `ifaces != null' to avoid a crash.
18988 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18990 * class.cs: when we build structs without fields that implement
18991 interfaces, we need to add the interfaces separately, since there is
18992 no API to both set the size and add the interfaces at type creation
18995 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18997 * expression.cs: the dimension arguments to the array constructors
18998 need to be converted if they are a long.
19000 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19002 * class.cs: don't emit ldarg.0 if there is no parent constructor
19003 (fixes showstopper for corlib).
19005 2002-06-29 Martin Baulig <martin@gnome.org>
19007 MCS now compiles corlib on GNU/Linux :-)
19009 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19010 ie. check for MethodImplOptions.InternalCall.
19012 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19013 and TypeManager.attribute_type are null, so we must explicitly check
19014 whether parent is not null to find out whether it's an attribute type.
19015 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19016 and SetBuilder, not only if the property is neither abstract nor external.
19017 This is necessary to set the MethodImplOptions on the accessor methods.
19018 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19019 SetBuilder, see Property.Emit().
19021 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19022 populate "System.Object", "System.ValueType" and "System.Attribute" since
19023 they've already been populated from BootCorlib_PopulateCoreTypes().
19025 2002-06-29 Martin Baulig <martin@gnome.org>
19027 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19028 is the NullLiteral, we also need to make sure that target_type is not
19031 2002-06-29 Martin Baulig <martin@gnome.org>
19033 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19034 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19035 before calling BootstrapCorlib_ResolveDelegate ().
19037 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19039 * statement.cs: fixed build-breaker. All tests passed ok.
19041 2002-06-27 Martin Baulig <martin@gnome.org>
19043 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19044 for System.Decimal when compiling corlib.
19046 2002-06-27 Martin Baulig <martin@gnome.org>
19048 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19049 switch blocks which contain nothing but a default clause.
19051 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19053 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19055 2002-06-27 Martin Baulig <martin@gnome.org>
19057 * ecore.cs (PropertyExpr.PropertyExpr): Call
19058 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19060 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19061 is already a TypeBuilder.
19063 2002-06-27 Martin Baulig <martin@gnome.org>
19065 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19066 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19067 the "from an array-type to System.Array" case. This makes it work
19068 when compiling corlib.
19070 2002-06-27 Martin Baulig <martin@gnome.org>
19072 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19073 non-static PropertyExpr, set its InstanceExpression. This makes
19074 the `ICollection.Count' property work in System/Array.cs.
19076 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19078 * driver.cs: Made error handling more consistent. Errors now
19079 tracked by Report class, so many methods which used to return int
19080 now return void. Main() now prints success/failure and
19081 errors/warnings message.
19083 Renamed '--probe' compiler argument to '--expect-error'. Removed
19084 the magic number return values (123 and 124). Now, if the
19085 expected error occurs, the compiler exits with success (exit value
19086 0). If the compilation completes without seeing that particular
19087 error, the compiler exits with failure (exit value 1). The
19088 makefile in mcs/errors has been changed to handle the new behaviour.
19090 * report.cs: Made 'expected error' number a property and renamed
19091 it from 'Probe' to 'ExpectedError'.
19093 * genericparser.cs: Removed error handling support, since it is
19094 now all done by Report class.
19096 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19097 class, so parse() no longer returns an int.
19099 * namespace.cs: Use Report.Error instead of GenericParser.error
19101 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19103 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19104 TypeContainer.AddOperator): At the front of the list put the
19105 explicit implementations, so they get resolved/defined first.
19107 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19109 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19110 interface type is implemented by this TypeContainer. Used during
19111 explicit interface implementation.
19113 (Property.Define, Indexer.Define, Method.Define): Validate that
19114 the given interface in the explicit implementation is one of the
19115 base classes for the containing type.
19117 Also if we are explicitly implementing an interface, but there is
19118 no match in the pending implementation table, report an error.
19120 (Property.Define): Only define the property if we are
19121 not explicitly implementing a property from an interface. Use the
19122 correct name also for those properties (the same CSC uses,
19123 although that is really not needed).
19125 (Property.Emit): Do not emit attributes for explicitly implemented
19126 properties, as there is no TypeBuilder.
19128 (Indexer.Emit): ditto.
19130 Hiding then means that we do not really *implement* a pending
19131 implementation, which makes code fail.
19133 2002-06-22 Martin Baulig <martin@gnome.org>
19135 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19136 the return value of Object.GetType(). [FIXME: we need to do this whenever
19137 we get a type back from the reflection library].
19139 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19141 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19143 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19145 * attribute.cs: Return null if we can not look up the type.
19147 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19148 the interface types found.
19150 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19151 interface types found.
19153 * typemanager.cs (GetInterfaces): Make this routine returns alll
19154 the interfaces and work around the lame differences between
19155 System.Type and System.Reflection.Emit.TypeBuilder in the results
19156 result for GetInterfaces.
19158 (ExpandInterfaces): Given an array of interface types, expand and
19159 eliminate repeated ocurrences of an interface. This expands in
19160 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19163 2002-06-21 Martin Baulig <martin@gnome.org>
19165 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19168 2002-06-21 Martin Baulig <martin@gnome.org>
19170 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19171 and called with one of the core types, return the corresponding typebuilder for
19174 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19177 2002-06-21 Martin Baulig <martin@gnome.org>
19179 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19180 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19181 (Expression.ConvertReferenceExplicit): Likewise.
19183 * expression.cs (ElementAccess.DoResolve): Likewise.
19184 (ElementAccess.DoResolveLValue): Likewise.
19186 2002-06-10 Martin Baulig <martin@gnome.org>
19188 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19189 add the "value" parameter to the parameter list.
19191 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19194 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19196 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19197 the argument to an int, uint, long or ulong, per the spec. Also
19198 catch negative constants in array creation.
19200 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19202 * class.cs: do not allow the same interface to appear twice in
19203 the definition list.
19205 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19207 * ecore.cs: don't use ldlen with System.Array.
19209 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19211 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19213 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19215 * modifiers.cs: produce correct field attributes for protected
19216 internal. Easy fix so miguel can work on ther harder stuff:-)
19218 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19220 * pending.cs: New file. Move the code from class.cs here.
19221 Support clearning the pending flag for all methods (when not doing
19222 explicit interface implementation).
19224 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19226 * rootcontext.cs: added a couple more types needed to bootstrap.
19228 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19230 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19231 constructor in the type, instead of any constructor in the type
19232 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19233 a bug in the Mono runtime when applying the params attribute).
19235 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19236 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19238 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19240 * expression.cs (Unary.ResolveOperator): Use TypeManager
19241 to resolve the type.
19243 2002-06-13 Ravi Pratap <ravi@ximian.com>
19245 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19248 * enum.cs (AddEnumMember): Add support to store the attributes associated
19249 with each member too.
19251 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19252 field builders too - this takes care of the enum member case.
19254 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19256 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19257 address-of operator on both value types and pointers.
19259 2002-06-10 Martin Baulig <martin@gnome.org>
19261 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19262 PropertyBuilder to the `property_builders' list.
19264 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19265 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19266 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19267 find any indexers which are inherited from an interface.
19269 2002-06-09 Martin Baulig <martin@gnome.org>
19271 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19272 the same type as the constant if necessary. There's also a test-130.cs
19275 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19277 * typemanager.cs (TypeManager.ChangeType): Previously known as
19278 Enum.ChangeEnumType().
19280 2002-06-09 Martin Baulig <martin@gnome.org>
19282 * expression.cs (Cast.TryReduce): Added support for consts.
19284 2002-06-08 Ravi Pratap <ravi@ximian.com>
19286 * class.cs (Accessor): Hold attributes information so we can pass
19289 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19290 Modify to pass in attributes attached to the methods.
19292 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19294 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19295 to handle the Accessor kind :-)
19297 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19299 2002-06-08 Martin Baulig <martin@gnome.org>
19301 * expression.cs (Unary.TryReduceNegative): Added support for
19304 2002-06-08 Martin Baulig <martin@gnome.org>
19306 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19307 name can't be found in the `defined_names' - the caller will do a
19308 MemberLookup in this case and thus find methods in System.Enum
19309 such as Enum.IsDefined().
19311 2002-06-08 Martin Baulig <martin@gnome.org>
19313 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19314 Convert.ChangeType() which works with TypeBuilder created types.
19315 (Enum.LookupEnumValue, Enum.Define): Use it here.
19317 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19318 `TypeBuilder.BaseType != null' check.
19319 (TypeContainer.FindMembers): Only lookup parent members if we
19320 actually have a parent.
19321 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19322 (ConstructorInitializer.Resolve): Likewise.
19324 * interface.cs (Interface.FindMembers): Added
19325 `TypeBuilder.BaseType != null' check.
19327 * rootcontext.cs (RootContext.ResolveCore): Added
19328 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19329 classes_second_stage.
19331 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19332 debug_type and trace_type when compiling with --nostdlib.
19334 2002-06-07 Martin Baulig <martin@gnome.org>
19336 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19337 (AddField): Set it to true when adding a non-static field.
19338 (DefineType): Use `have_nonstatic_fields' to find out whether we
19339 have non-static fields, not `Fields != null'.
19341 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19343 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19344 dereferencing a null on the static-field code path)
19346 2002-05-30 Martin Baulig <martin@gnome.org>
19348 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19349 to take command line arguments. Use reflection to call the new
19350 custom `Initialize' function on the symbol writer and pass it the
19351 command line arguments.
19353 * driver.cs (--debug-args): New command line argument to pass command
19354 line arguments to the symbol writer.
19356 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19358 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19359 the target type for indexers and properties. Thanks to Joe for
19362 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19364 * typemanager.cs (MethodFlags): returns the method flags
19365 (Obsolete/ShouldIgnore) that control warning emission and whether
19366 the invocation should be made, or ignored.
19368 * expression.cs (Invocation.Emit): Remove previous hack, we should
19369 not do this on matching a base type, we should do this based on an attribute
19371 Only emit calls to System.Diagnostics.Debug and
19372 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19373 on the command line.
19375 * rootcontext.cs: Global settings for tracing and debugging.
19377 * cs-tokenizer.cs (define): New utility function to track
19378 defines. Set the global settings for TRACE and DEBUG if found.
19380 2002-05-25 Ravi Pratap <ravi@ximian.com>
19382 * interface.cs (Populate*): Pass in the TypeContainer as well as
19383 the DeclSpace as parameters so that we can create EmitContexts and
19384 then use that to apply attributes etc.
19386 (PopulateMethod, PopulateEvent, PopulateProperty)
19387 (PopulateIndexer): Apply attributes everywhere.
19389 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19392 (ApplyAttributes): Update accordingly.
19394 We now apply interface attributes for all members too.
19396 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19398 * class.cs (Indexer.Define); Correctly check if we are explicit
19399 implementation (instead of checking the Name for a ".", we
19400 directly look up if the InterfaceType was specified).
19402 Delay the creation of the PropertyBuilder.
19404 Only create the PropertyBuilder if we are not an explicit
19405 interface implementation. This means that explicit interface
19406 implementation members do not participate in regular function
19407 lookups, and hence fixes another major ambiguity problem in
19408 overload resolution (that was the visible effect).
19410 (DefineMethod): Return whether we are doing an interface
19413 * typemanager.cs: Temporary hack until we get attributes in
19414 interfaces (Ravi is working on that) and we get IndexerName
19415 support in interfaces.
19417 * interface.cs: Register the indexers as properties.
19419 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19420 warning, I have verified that this is a bug in the .NET runtime
19421 (JavaScript suffers of the same problem).
19423 * typemanager.cs (MemberLookup): When looking up members for
19424 interfaces, the parent of an interface is the implicit
19425 System.Object (so we succeed in searches of Object methods in an
19426 interface method invocation. Example: IEnumerable x; x.ToString
19429 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19431 * class.cs (Event): Events should also register if they do
19432 implement the methods that an interface requires.
19434 * typemanager.cs (MemberLookup); use the new GetInterfaces
19437 (GetInterfaces): The code used to lookup interfaces for a type is
19438 used in more than one place, factor it here.
19440 * driver.cs: Track the errors at the bottom of the file, we kept
19443 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19444 instance if the method we are calling is static!
19446 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19448 * attribute.cs (ApplyAttributes): Make this function filter out
19449 the IndexerName attribute (as that attribute in reality is never
19450 applied) and return the string constant for the IndexerName
19453 * class.cs (TypeContainer.Emit): Validate that all the indexers
19454 have the same IndexerName attribute, and if so, set the
19455 DefaultName attribute on the class.
19457 * typemanager.cs: The return value might contain other stuff (not
19458 only methods). For instance, consider a method with an "Item"
19459 property and an Item method.
19461 * class.cs: If there is a problem with the parameter types,
19464 2002-05-24 Ravi Pratap <ravi@ximian.com>
19466 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19467 looks at user defined conversion after making a call to
19468 StandardConversionExists - we need this for overload resolution.
19470 * expression.cs : Update accordingly the various method calls.
19472 This fixes 2 bugs filed against implicit user defined conversions
19474 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19476 * statement.cs: Track the result of the assignment.
19478 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19480 * expression.cs (MemberAccess): Improved error reporting for
19481 inaccessible members.
19483 2002-05-22 Martin Baulig <martin@gnome.org>
19485 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19486 itself with debugging support.
19488 2002-05-22 Martin Baulig <martin@gnome.org>
19490 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19491 Removed, this isn't needed anymore.
19493 2002-05-20 Martin Baulig <martin@gnome.org>
19495 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19496 be underlying type for an enum.
19498 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19500 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19501 that splits out the loading of just the core types.
19503 * rootcontext.cs (ResolveCore): Split the struct resolution in
19504 two, so we can load the enumeration underlying types before any
19507 * expression.cs (Is): Bandaid until we fix properly Switch (see
19508 bug #24985 for details).
19510 * typemanager.cs (ImplementsInterface): The hashtable will contain
19511 a null if there are no interfaces implemented.
19513 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19515 * cs-parser.jay (indexer_declarator): It is fine to have array
19518 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19520 * typemanager.cs: (RegisterBuilder): New function used to register
19521 TypeBuilders that implement interfaces. Since
19522 TypeBuilder.GetInterfaces (as usual) does not work with lame
19524 (AddUserType): register interfaces.
19526 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19527 dealing with TypeBuilder. Also, arrays are showing up as
19528 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19529 methods can not be invoked on them!
19531 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19532 (ImplicitReferenceConversionExists): Split out from
19533 StandardConversionExists.
19535 * expression.cs (As): We were only implementing one of the three
19536 cases for the as operator. We now implement them all.
19537 (Is): Implement the various other cases for Is as well.
19539 * typemanager.cs (CACHE): New define used to control if we want or
19540 not the FindMembers cache. Seems to have a negative impact on
19541 performance currently
19543 (MemberLookup): Nested types have full acess to
19544 enclosing type members
19546 Remove code that coped with instance/static returns for events, we
19547 now catch this in RealFindMembers.
19549 (RealFindMembers): only perform static lookup if the instance
19550 lookup did not return a type or an event.
19552 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19554 * assign.cs (CompoundAssign): We pass more semantic information
19555 now to Compound Assignments than we did before: now we have all
19556 the information at hand, and now we resolve the target *before* we
19557 do the expression expansion, which allows the "CacheValue" method
19558 to have the effect we intended (before, a [x] += 1 would generate
19559 two differen ArrayAccess expressions from the ElementAccess,
19560 during the resolution process).
19562 (CompoundAssign.DoResolve): Resolve target and original_source here.
19564 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19566 * expression.cs (ArrayAccess): dropped debugging information.
19568 * typemanager.cs: Small bug fix: I was always returning i_members,
19569 instead of one of i_members or s_members (depending on which had
19572 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19573 method is invoked before any code generation takes place, and it
19574 is a mechanism to inform that the expression will be invoked more
19575 than once, and that the method should use temporary values to
19576 avoid having side effects
19578 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19580 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19583 * expression.cs (Indirection, ArrayAccess): Add support for
19584 CacheTemporaries in these two bad boys.
19586 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19587 ldobj or ldind_ref.
19588 (StoreFromPtr): Handle stobj as well.
19590 * expression.cs (UnaryMutator): Share more code.
19592 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19593 down: I was not tracking the Filter function as well, which
19594 was affecting the results of the cache.
19596 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19598 * attribute.cs: Remove the hack to handle the CharSet property on
19601 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19603 * attribute.cs (DoResolve): More uglyness, we now only try to
19604 resolve the attribute partially, to extract the CharSet
19605 information (only if we are a StructLayout attribute). Otherwise
19607 (GetExtraTypeInfo): Add some code to conditionally kill in the
19608 future this. I am more and more convinced that the .NET
19609 framework has special code to handle the attribute setting on
19612 * expression.cs (IsParamsMethodApplicable): Revert my previous
19613 foreach change here, it was wrong.
19615 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19617 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19618 (pp_expr): do not abort on unknown input, just return.
19619 (eval): abort if there are pending chars.
19621 * attribute.cs (Attribute.Resolve): Positional parameters are
19622 optional. Deal with that case.
19624 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19625 the Ansi/Unicode/Auto information for the type.
19627 (TypeContainer.DefineType): instantiate the EmitContext here, as
19628 we will be using it during the type definition (to resolve
19629 attributes) and during the emit phase.
19631 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19632 to pull type information out of the attributes
19634 (Attribute.Resolve): track the constructor builder, and allow for
19635 multiple invocations (structs and classes will use this).
19637 * ecore.cs (MemberLookupFinal): new version with all the
19638 parameters customizable.
19640 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19641 constructors. Return if the result value is null (as the error
19642 would have been flagged already by MemberLookupFinal)
19644 Do not allow instances of abstract classes or interfaces to be
19647 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19648 We have to compare the assembly property here when dealing with
19649 FamANDAssem and Assembly access modifiers, because we might be
19650 creating an assembly from *modules* (that means that we are not
19651 getting TypeBuilders for types defined in other modules that are
19652 part of this assembly).
19654 (Method.Emit): If the method is marked abstract and has a body,
19657 (TypeContainer.DefineMembers): If both the defined member and the
19658 parent name match are methods, then do not emit any warnings: let
19659 the Method.Define routine take care of flagging warnings. But if
19660 there is a mismatch (method overrides something else, or method is
19661 overriwritten by something, then emit warning).
19663 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19664 set to null, this means `do not check for the return type on the
19667 (Method.Define): set the return type for the method signature to
19668 null, so that we get methods with the same name and parameters and
19669 different return types. This is used to flag warning 114 (you are
19670 hiding a method, and you probably want to use the new/override
19673 * typemanager.cs (MemberLookup): Implemented proper access
19674 control, closing a long standing set of bug reports. The problem
19675 was that the Framework only has two bits: Public and NonPublic,
19676 and NonPublic includes private and protected methods, but we need
19677 to enforce the FamANDAssem, FamOrAssem and Family.
19679 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19681 * statement.cs (GotoCase): Return true: Ammounts to giving up
19682 knowledge on whether we return or not, and letting the other case
19683 be responsible for it.
19685 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19687 * driver.cs: Do not load directories for each file processed, only
19688 do it if there is a pattern.
19690 * ecore.cs: Report readonly assigns here as well, as we might have
19691 been resolved only by MemberAccess.
19693 (SimpleName.SimpleNameResolve): Also be useful for LValue
19694 resolution. We need this to propagate assign to local readonly variables
19696 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19697 do not want to reuse potential criteria memory.
19699 * class.cs (MyEventBuilder): Set reflected_type;
19701 * ecore.cs (Constantify): Added support for constifying bools.
19703 (RootContext.LookupType): Added a cache for values looked up in
19704 the declaration space.
19706 * typemanager.cs (FindMembers): Now is a front-end to
19707 RealFindMembers, and provides a two-level hashtable-based cache to
19710 15% performance improvement: from 22.5 to 19.2 seconds.
19712 * expression.cs (IsParamsMethodApplicable): use foreach.
19713 (Invocation.DoResolve): ditto.
19714 (New.DoResolve): ditto.
19715 (ArrayCreation.DoResolve): ditto.
19717 * ecore.cs (FindMostEncompassingType): use foreach.
19719 * delegate.cs (NewDelegate.DoResolve): Use foreach
19721 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19722 (RemoveMethods): use foreach.
19724 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19725 nested foreach statements instead of for, and also break out of
19726 the inner loop once a match is found.
19728 (Invocation.OverloadResolve): Use foreach, simplify the code.
19730 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19732 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19733 we actually unwrap the expression to allow for extra information
19736 * expression.cs: Use Shr_Un on unsigned operations.
19738 2002-05-08 Ravi Pratap <ravi@ximian.com>
19740 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19741 applicable operators was not being considered correctly. This closes
19742 the bug Miguel reported.
19744 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19746 * attribute.cs: check that the type derives from System.Attribute
19747 and report the correct error in that case (moved the duplicate code to
19748 its own method, too).
19750 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19752 * attribute.cs: lookup attribute type name as the spec says: first the
19753 bare attribute name and then name + "Attribute" (nant compiles with
19754 mcs after this fix).
19756 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19758 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19759 Because of the way we parse things, we should try to see if a
19760 UIntConstant can fit in an integer.
19762 2002-05-07 Ravi Pratap <ravi@ximian.com>
19764 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19765 when we are in an explicit context.
19767 (ConvertReferenceExplicit): When converting from Iface type S to Class
19768 T make sure the rules are implemented as an OR.
19770 * parameter.cs (ParameterType): Make it a property for now although the
19771 purpose really isn't anything immediate.
19773 * expression.cs (Is*Applicable): Do better checking on the parameter type
19774 of a ref/out parameter. The ones from the system assemblies are already
19775 marked with the correct type so we don't need to do any correction.
19777 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19778 the object type is standard too so include that.
19780 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19782 * ecore.cs (StandardConversionExists): Augment with missing code:
19783 deal with IntConstant, LongConstants and Enumerations.
19785 * assign.cs: Report the error, instead of failing silently
19787 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19788 typecontainer that they are declared, because the
19789 typecontainer/namespace will have the list of using clauses that
19790 need to be applied.
19792 Assembly Attributes were escaping the normal registration
19795 (EmitCode): Apply attributes within an EmitContext that represents
19796 the container they were declared on.
19798 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19800 2002-05-06 Ravi Pratap <ravi@ximian.com>
19802 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19803 Revamp completely - make much cleaner as we now operate only
19806 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19807 to implement the logic detailed in the spec more correctly.
19809 (UserDefinedConversion): Update accordingly.
19811 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19813 * statement.cs: Return flow analysis information up.
19815 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19818 (token): Do not consume an extra character before calling
19821 2002-05-06 Piers Haken <piersh@friskit.com>
19823 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19825 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19827 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19828 EmitContext during the instance constructor initializer
19829 resolution, to stop access to instance variables.
19831 This is mandated by the spec, last paragraph of the `constructor
19832 initializers' section.
19834 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19836 * cs-parser.jay, class.cs (Accessor): new class used to represent
19837 an accessor (get or set). In the past we used `null' to represent
19838 a missing accessor. But this is ambiguous because there was no
19839 way to tell in abstract indexers/properties if one of them was
19842 Now there is a way of addressing that.
19844 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19845 instead of FindMembers.
19847 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19848 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19850 * attribute.cs: Treat indexers and properties as the same in terms
19851 of applying attributes
19853 * ecore.cs (FindMostEncompassedType): Use statically initialized
19854 EmptyExpressions()s like we do elsewhere to avoid creating useless
19855 objects (and we take this out of the tight loop).
19857 (GetConversionOperators): Move the code to extract the actual
19858 operators to a separate routine to clean things up.
19860 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19862 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19863 events are always registered FieldBuilders.
19865 * class.cs (FieldBase): New class shared by Fields
19867 * delegate.cs: If we are a toplevel delegate, use our full name.
19868 If we are a nested delegate, then only use our tail name.
19870 2002-05-02 Ravi Pratap <ravi@ximian.com>
19872 * expression.cs (IsApplicable): Ensure that we add the "&" to
19873 ref/out types before comparing it with the type of the argument.
19875 (IsParamsMethodApplicable): Ditto.
19877 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19880 * delegate.cs : Handle the case when we have more than one applicable
19881 method. Flag an error only when we finish checking all.
19883 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19885 * expression.cs: Add support for boolean static initializers.
19887 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19889 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19891 * parameter.cs (ComputeParameterTypes,
19892 ComputeAndDefineParameterTypes): Better error handling: now we
19893 clear the `types' cache if we fail during any of the type lookups.
19894 We also return the status code correctly to our caller
19896 * delegate.cs: If we fail to define a delegate, abort the extra
19899 * expression.cs (Binary.ResolveOperator): for
19900 operator==(object,object) and operator !=(object, object) we also
19901 have to verify that there is an implicit conversion from one to
19904 (ArrayAccess.DoResolve): Array Access can operate on
19907 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19909 * assign.cs (CompoundAssign): A new class used as a "flag" that
19910 the assignment actually is happening as part of a compound
19911 assignment operator.
19913 During compound assignment, a few new rules exist to enable things
19920 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19921 to the type of x) if y is implicitly convertible to the type of x,
19922 and the operator is a builtin operator and the return type of the
19923 operator is explicitly convertible to the type of x.
19925 * rootcontext.cs: Reset warning level to 2. 4 catches various
19926 "interesting" features in mcs, we must clean this up at some
19927 point, but currently am trying to kill other bugs ;-)
19929 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19930 in container classes as well.
19932 * expression.cs (Binary.ResolveOperator): Handle string case
19933 before anything else (as operator overloading does emit an error
19934 before doing anything else).
19936 This code could go away when we move to a table driven model, but
19937 i could not come up with a good plan last night.
19939 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19941 * typemanager.cs (CSharpName): reimplementation using regex.
19942 * class.cs: added null check for fields in Emit
19943 * rootcontext.cs: set warninglevel to 4
19945 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19947 * typemanager.cs (CSharpName): reimplemented with Lupus
19950 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19952 * statement.cs (If): correclty implement Resolve, because we were
19953 not catching sem errors in there. The same process is needed
19955 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19958 (Statement.Warning_DeadCodeFound): Factorize code.
19959 (While): Report dead code here too.
19961 (Statement): Added Resolve virtual method to allow
19962 for resolution split from the emit code.
19964 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19966 * statement.cs (EmitBoolExpression): No longer try to resolve the
19968 (MakeBoolean): New utility function that resolve, implicitly
19969 converts to boolean and tags the expression.
19972 (If, Do): Implement dead code elimination.
19973 (While): Implement loop inversion
19975 (Do, While, For, If): Resolve the expression prior to calling our
19978 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19981 - added method Report28 (warning: program has more than one entry point)
19982 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19983 - modified method Method.Define, the part at the end of the method
19985 * rootcontext.cs: added static public Location EntryPointLocation;
19987 * ../errors/cs0028.cs : Add test case for the above warning.
19990 - modified method CSharpName to allow arrays of primitive type to
19991 be printed nicely (e.g. instead of System.Int32[][] it now prints
19993 - added method CSharpSignature: returns the signature of a method
19994 in string format to be used in reporting errors, warnings, etc.
19996 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19999 2002-04-26 Ravi Pratap <ravi@ximian.com>
20001 * delegate.cs (Define): Fix extremely silly bug where I was
20002 setting the type of the 'object' parameter of the BeginInvoke
20003 method to System.IAsyncResult instead of System.Object ;-)
20005 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20007 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20010 (Constructor.Emit): return if we fail to initialize the
20011 constructor. Another door closed!
20013 * expression.cs (New.DoResolve): Improve error message (from -6 to
20014 1501). Use DeclaredOnly lookup to find the exact constructor.
20016 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20017 loop. This is useful.
20019 * cs-parser.jay: Adjust the default parameters so that destructors
20020 have the proper signature.
20022 2002-04-26 Martin Baulig <martin@gnome.org>
20024 * driver.cs (LoadAssembly): If `assembly' contains any characters
20025 which are only valid in path names and not in assembly names
20026 (currently slash, backslash and point), use Assembly.LoadFrom ()
20027 instead of Assembly.Load () on the `assembly' (before iteration
20028 over the link_paths).
20030 2002-04-26 Martin Baulig <martin@gnome.org>
20032 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20034 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20036 * class.cs (Property): use the new typemanager.MemberLookup
20038 (TypeContainer.MemberLookup): Implement using the
20039 TypeManager.MemberLookup now.
20041 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20042 and return MemberInfos, so that these can be used without an
20043 EmitContext (what we had before).
20045 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20047 * expression.cs: Fix the case where the argument to params if the
20048 type of the params. I omitted handling this before. Fixed
20050 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20052 * driver.cs: Call BootCorlib_PopulateCoreType
20054 * class.cs (Property.CheckBase): Check for properties only, not
20057 * interface.cs: Temporary hack: try/catch around the
20058 CustomAttributeBuilder, because I am getting an exception that I
20061 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20062 types whose definitions are required to be there (attributes are
20063 defined before standard types).
20065 Compute definitions as we boot the various types, as they are used
20066 immediately (value_type class will need object_type, but if we do
20067 not initialize object_type, we will pass a null, which will let
20068 the runtime pick the System.Object from the existing corlib, which
20069 is not what we want).
20071 2002-04-22 Patrik Torstensson <totte@labs2.com>
20073 * cs-tokenizer.cs: fixed a number of trim() issues.
20075 2002-04-22 Ravi Pratap <ravi@ximian.com>
20077 * expression.cs (Argument.Type): Ensure that we return the correct
20078 type when we have out or ref parameters [in which case we
20081 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20083 * class.cs (Property, Indexer): Allow extern modifier in there.
20085 * typemanager.cs (InitBaseTypes): Initializes object_type and
20086 value_type, since those will be used early on during the bootstrap
20087 process to compile corlib.
20089 (InitCoreTypes): Move code from here to InitBaseTypes.
20091 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20093 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20094 single-dimension arrays as using the ldlen opcode.
20096 Daniel Lewis discovered this optimization.
20098 * typemanager.cs: Add signature for System.Array::get_Length
20100 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20102 * statement.cs: report the error when the foreach does not apply to an
20103 array nor a collection.
20105 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20107 * expression.cs: Add implicit conversions to the operator ~.
20109 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20111 * typemanager.cs: Locate the decimal constructor.
20113 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20115 * attribute.cs: use the new property of TypeOf.
20116 * expression.cs: added 'get' property around typearg.
20118 These changes fix a build breaker reported by NickD. Is this the
20119 correct way to fix? If not, please, revert my changes and make it
20122 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20124 * attribute.cs: Add support for typeof in attribute invocations.
20125 I am not sure that this is right though.
20127 2002-04-14 Duncan Mak <duncan@ximian.com>
20129 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20130 Binary.Operator.Division case.
20132 2002-04-13 Ravi Pratap <ravi@ximian.com>
20134 * class.cs (DefineType): Ensure that we do a proper check on
20135 attribute types and also register it with the TypeManager.
20137 (TypeContainer.Targets): The default for attribute types is
20138 AttributeTargets.All.
20140 * attribute.cs (ApplyAttributes): Registering the attribute type
20141 is done elsewhere, not when we discover we have a Usage attribute.
20143 2002-04-12 Ravi Pratap <ravi@ximian.com>
20145 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20146 and get rid of is_delegate parameter.
20148 * everywhere : update.
20150 2002-04-12 Ravi Pratap <ravi@ximian.com>
20152 * cs-parser.jay (compilation_unit): Revamp completely to use
20153 some new ideas that I got from Rhys' grammar to solve the problems
20154 with assembly level attributes.
20156 (outer_declaration): New grammar production.
20158 (attribute_sections): Add.
20160 (opt_attributes): Base on attribute_sections
20162 (namespace_declaration): Allow opt_attributes to tackle the case
20163 when we have assembly level attributes - we are clever in this
20166 * attribute.cs (ApplyAttributes): Do not worry about assembly
20167 attributes in the non-global context.
20169 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20170 instead of SetGlobalAttributes.
20172 * class.cs, rootcontext.cs : Ensure we define and generate
20173 attribute types before anything else.
20175 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20176 and flag the new error -20 for the case when the attribute type
20177 does not have valid targets specified. csc does not catch this.
20179 * ../errors/errors.txt : update for error # -20
20181 2002-04-11 Ravi Pratap <ravi@ximian.com>
20183 * support.cs (InternalParameters.ParameterModifier): Do some null
20184 checking and return sane values.
20186 * class.cs (Method.Define): If we are a PInvoke method, ensure
20187 that we are static and extern. Report error # 601
20189 * ../errors/cs0601.cs : Add test case for the above error.
20191 2002-04-07 Ravi Pratap <ravi@ximian.com>
20193 * rootcontext.cs (attribute_types): We need to keep type of
20194 all attribute types separately and emit code for them first.
20196 (RegisterAttribute) : Implement.
20198 * class.cs (DefineType): Check if the current Type is a custom
20199 attribute type and register it accordingly.
20201 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20202 adding the first attribute twice and rename to
20204 (SetGlobalAttributes): this.
20206 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20209 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20210 if we are processing global arguments. Hmm, I am unsure of this.
20212 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20214 * expression.cs: added static array of strings to avoid calling
20215 Enum.ToString () for Operator in Binary. Significant recover of
20218 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20220 * class.cs (FindMembers): Allow the Builders of the various
20221 members to be null. If they are skip them. This only happens
20222 during the PInvoke declaration.
20224 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20226 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20227 failure, so we do not keep going afterwards.
20229 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20230 wanted to pass `false' as the `is_delegate' argument. If this is
20231 the case, why not use delegate_type == null to mean `is_delegate =
20232 false' and anything else as is_delegate = true.
20234 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20236 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20237 code for the section, not the beginning of the tests.
20239 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20241 * cfold.cs: Handle operator + (Enum x, Underlying x)
20243 * expression.cs (Binary): same. Warn about errors where we have
20244 Enum/Enum in operator + as well.
20246 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20249 - added support for switch(bool)
20250 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20251 - add TableSwitchEmit() to handle table-based switch statements
20253 2002-04-05 Ravi Pratap <ravi@ximian.com>
20255 * expression.cs (Invocation.OverloadResolve): Factor out code which
20256 does parameter compatibility checking with arguments so that we can
20257 re-use the code even from Delegate.VerifyApplicability
20259 (VerifyArgumentsCompat): Move above code here.
20261 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20262 and instead make a call to the above method.
20264 2002-03-31 Ravi Pratap <ravi@ximian.com>
20266 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20267 We use it to keep track of classes which are attribute types.
20269 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20271 * delegate.cs (Delegate.Define): Correctly define the types in the
20272 presence of fixed and array parameters.
20274 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20277 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20278 include NonPublic after the first iteration.
20280 * class.cs (Indexer.CheckBase): Only check if both parents are
20283 * cs-parser.jay (accessor_body): If empty, set to null.
20285 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20286 same code path here to resolve constants names that we did have in
20287 MemberAccess.DoResolve. There is too much code duplicated here.
20289 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20291 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20293 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20296 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20297 tokens, numbers and strings.
20299 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20302 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20303 asyncronous parameters and the regular parameters.
20305 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20306 specify the target directory.
20308 * expression.cs: (This.DoResolve): Simplify
20309 (As.Emit): Optimize, do not generate IsInst if the expression is
20310 always of the given type.
20312 (Is.DoResolve): Bug fix, we were reporting both always/never for
20315 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20316 creating too many unnecessary arrays.
20318 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20320 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20321 fields instead of rolling our own initializer. Takes care of all
20322 implicit conversions, and drops unnecessary static checks/argument.
20324 2002-03-31 Dick Porter <dick@ximian.com>
20326 * driver.cs: use the GetDirectories() return values properly, and
20327 use "/" as path separator.
20329 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20331 * expression.cs (Unary): Optimize - - expr into expr.
20332 (Binary): Optimize a + (-b) into a -b.
20334 * codegen.cs (CodeGen): Made all methods static.
20336 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20340 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20341 TypeBuilder property.
20343 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20346 * tree.cs: Removed the various RecordXXXX, and replaced with a
20347 single RecordDecl. Removed all the accessor methods, and just
20348 left a single access point Type
20350 * enum.cs: Rename DefineEnum to DefineType.
20352 * decl.cs: New abstract method `DefineType' used to unify the
20353 Defines for Enumerations, Interfaces, TypeContainers and
20356 (FindType): Moved LookupInterfaceOrClass here. Moved the
20357 LookupBaseClasses method that used to live in class.cs and
20358 interface.cs here, and renamed to FindType.
20360 * delegate.cs: Implement DefineType. Take advantage of the
20361 refactored pattern for locating the parent builder without taking
20362 the parent_builder argument (which we know does not work if we are
20363 nested, and triggering a toplevel definition).
20365 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20367 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20368 accessibility of a member has changed during override and report
20371 * class.cs (Method.Define, Property.Define): Only complain on
20372 overrides if the method is private, any other accessibility is
20373 fine (and since we just checked the permission is the same, we are
20376 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20377 and elif are processed always. The other pre-processing
20378 directives are only processed if we are "taking" the path
20380 2002-03-29 Martin Baulig <martin@gnome.org>
20382 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20383 current location is not Null.
20385 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20386 a separate method so we can profile it.
20388 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20389 `span.Seconds' are just seconds, but no minutes or hours.
20390 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20392 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20394 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20395 Remove the gratuitous set of Final:
20397 // If an interface implementation, then we can set Final.
20398 if (((flags & MethodAttributes.Abstract) == 0) &&
20399 implementing.DeclaringType.IsInterface)
20400 flags |= MethodAttributes.Final;
20402 I do not know what I was smoking when I used that.
20405 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20406 step into fixing the name resolution issues for delegates and
20407 unifying the toplevel name resolution.
20409 2002-03-28 Martin Baulig <martin@gnome.org>
20411 * class.cs (Method.Emit): If we have a symbol writer, call its
20412 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20413 tell it about the current method.
20415 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20416 writer that we're going to emit the first byte of IL code for a new
20417 statement (a new source line).
20418 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20419 EmitContext.Mark() before emitting any code.
20421 * location.cs (SymbolDocument): Return null when we're Null.
20423 * statement.cs (Statement): Moved the `Location loc' variable here.
20424 (Statement.EmitBoolExpression): If we have a symbol writer, call
20425 ec.Mark() before emitting any code to tell it that we're at the
20426 beginning of a new statement.
20427 (StatementExpression): Added `Location' argument to the constructor.
20428 (Block): Added public readonly variable `StartLocation' and public
20429 variable `EndLocation'. The latter is to be set using SetEndLocation().
20430 (Block): Added constructor which takes a start and end location.
20431 (Block.SetEndLocation): New method. This sets the end location.
20432 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20433 local variables we create.
20434 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20435 each statement and do also mark the begin and end of the block.
20437 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20438 tell it the current lexer.Location, use Location.Null for the end of the
20440 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20441 current block, set its end location using SetEndLocation().
20442 (statement_expression): StatementExpression constructor now takes the
20443 lexer.Location as additional argument.
20444 (for_statement, declare_local_variables): Likewise.
20445 (declare_local_variables): When creating a new implicit block, use the
20446 new Block constructor and pass it the lexer.Location.
20448 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20450 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20451 members also on the parent interfaces recursively.
20453 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20455 * report.cs: Use new formats, since Gonzalo finished the missing
20458 * expression.cs (Binary.ResolveOperator): added missing operator|
20459 operator& and operator^ for bool/bool.
20461 * cs-parser.jay: CheckDef now takes a Location argument that is
20462 used to report errors more precisly (instead of reporting the end
20463 of a definition, we try to track something which is a lot closer
20464 to the source of the problem).
20466 * cs-tokenizer.cs: Track global token use, so we can properly flag
20467 the use of #define/#undef after the first token has been seen.
20469 Also, rename the reportXXXX to Error_DescriptiveName
20471 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20472 TypeContainer, so that Enum and Interface can use this too.
20474 * class.cs (TypeContainer.LookupInterfaceOrClass,
20475 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20476 `builder' argument. Typically this was used to pass the parent
20477 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20480 The problem is that a nested class could trigger the definition of
20481 a toplevel class, and the builder would be obviously wrong in that
20484 So we drop this argument, and we compute dynamically the
20485 TypeBuilder/ModuleBuilder (the correct information was available
20486 to us anyways from DeclSpace.Parent)
20488 * interface.cs (Interface.DefineInterface): Drop builder
20489 parameter cleanup like class.cs
20491 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20494 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20497 (Try.Emit): Propagate the returns value from the statement.
20499 (Return.Emit): Even if we are leavning
20501 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20503 * modifiers.cs: Fix the computation of MethodAttributes flags.
20505 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20507 * driver.cs: allow compilation of files that start with '/'.
20508 Add a default case when checking the argument of --target.
20510 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20512 * interface.cs: Implement the same search algorithm for types in
20513 the interface code.
20515 * delegate.cs: Do not allow multiple definition.
20517 * Recovered ChangeLog that got accidentally amputated
20519 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20521 * rootcontext.cs: Load manually enum to allow core classes to
20522 contain enumerations.
20524 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20525 Update to new static methods in TypeManager.
20527 * typemanager.cs (GetMethod, GetConstructor): Use our
20528 implementation of FindMembers to find the members, since during
20529 corlib compilation, the types are TypeBuilders and GetMethod and
20530 GetConstructor do not work.
20532 Make all methods in TypeManager static.
20534 (InitCodeHelpers): Split the functionality from
20535 the InitCodeTypes function.
20537 * driver.cs: Call InitCodeHelpers after we have populated the
20540 * cs-parser.jay (delegate_declaration): we did not used to compute
20541 the delegate name correctly for void delegates.
20543 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20545 * rootcontext.cs (RootContext): Init the interface_resolve_order
20546 and type_container_resolve_order always.
20548 (ResolveCore, BootstrapCorlib_ResolveClass,
20549 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20550 compiler when compiling with --nostdlib
20552 * class.cs (TypeContainer.DefineType): Check that our parent is
20553 not null. This test is most important when we are bootstraping
20556 * codegen.cs: Split out the symbol writing code.
20558 2002-03-25 Martin Baulig <martin@gnome.org>
20560 * driver.cs (-g): Made -g an alias for --debug.
20562 2002-03-24 Martin Baulig <martin@gnome.org>
20564 * codegen.cs (SymbolWriter): New public variable. Returns the
20565 current symbol writer.
20566 (CodeGen): Added `bool want_debugging_support' argument to the
20567 constructor. If true, tell the ModuleBuild that we want debugging
20568 support and ask it for the ISymbolWriter.
20569 (Save): If we have a symbol writer, call it's Close() method after
20570 saving the assembly.
20572 * driver.c (--debug): New command line argument to create a
20573 debugger information file.
20575 * location.cs (SymbolDocument): New public property. Returns an
20576 ISymbolDocumentWriter object for the current source file or null
20577 if we don't have a symbol writer.
20579 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20581 * driver.cs (LoadAssembly): Correctly return when all the paths
20582 have been tried and not before.
20584 * statement.cs (Switch.Emit): return the actual coverage for this
20585 statement (returns/not-returns)
20587 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20588 switch of the statement if we are the last switch section. That
20589 kills two problems: try/catch problems (we used to emit an empty
20590 nop at the end) and switch statements where all branches would
20593 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20595 * driver.cs: Add default assemblies (the equivalent to the
20596 Microsoft CSC.RSP file)
20598 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20599 also update tokens_seen and set it to false.
20601 * driver.cs: Implement --recurse for Mike.
20603 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20604 correctly splitting out the paths.
20606 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20608 * interface.cs (Interface.PopulateProperty): Instead of using
20609 `parent' as the declaration space for the set parameters, use
20612 * support.cs (InternalParameters): InternalParameters constructor
20613 takes a DeclSpace instead of a TypeContainer.
20615 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20616 types are being initialized, load the address of it before calling
20619 (New): Provide a mechanism to disable the generation of local
20620 value type temporaries when the caller will be providing us with
20621 an address to store it.
20623 (ArrayCreation.EmitDynamicInitializers): Use it.
20625 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20627 * expression.cs (Invocation.EmitArguments): Only probe for array
20628 property if there is more than one argument. Sorry about that.
20630 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20631 empty param arrays.
20633 * class.cs (Method.LabelParameters): Fix incorrect code path that
20634 prevented the `ParamArrayAttribute' from being applied to the
20637 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20639 * support.cs (ReflectionParameters): Correctly compute whether the
20640 last argument is a params array. Fixes the problem with
20643 * typemanager.cs: Make the assemblies array always be non-null
20644 (empty, but non-null)
20646 * tree.cs (RecordDecl): New function that abstracts the recording
20647 of names. This reports error 101, and provides a pointer to the
20648 previous declaration. Fixes a crash in the compiler.
20650 * cs-parser.jay (constructor_declaration): Update to new grammar,
20651 and provide a constructor_body that can be empty.
20653 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20655 * driver.cs: Add support for --resources.
20657 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20658 Make all types for the various array helper methods be integer.
20660 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20661 CheckState to ConvCast.
20663 (ConvCast): Now it takes a `checked' state argument, to avoid
20664 depending on the emit context for the conversion, and just using
20665 the resolve time setting.
20667 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20668 instead of Invocation.EmitArguments. We do not emit the original
20669 arguments, instead we emit those which have been converted to
20670 unsigned int expressions.
20672 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20674 * codegen.cs: ditto.
20676 * expression.cs (LocalVariableReference): Drop the use of the
20677 Store function that depended on the variable index.
20679 * statement.cs (VariableInfo): Drop the `Idx' property from this
20680 class, as this is not taking into account the indexes for
20681 temporaries tat we generate during the execution, getting the
20684 * class.cs: First emit class initializers, then call the parent
20687 * expression.cs (Binary): Fix opcode emision.
20688 (UnaryMutator.EmitCode): Support checked code generation
20690 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20691 matches for events for both the Static and Instance scans,
20692 pointing to the same element. Fix that.
20694 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20696 * rootcontext.cs (ResolveTree): Always set the
20697 interface_resolve_order, because nested interfaces will be calling
20700 * class.cs (GetInterfaceOrClass): Track the same resolution
20701 process used by TypeManager.LookupType. This fixes the nested
20702 type lookups in class declarations (separate path from
20705 (TypeContainer.DefineType): Also define nested interfaces.
20706 (TypeContainer.RegisterOrder): New public function used to
20707 register the order in which child interfaces need to be closed.
20709 Nested interfaces need to be closed after their parents have been
20712 * interface.cs (InterfaceAttr): Put all the logic for computing
20713 the interface attribute here.
20715 (DefineInterface): Register our interface order with the
20716 RootContext or with the TypeContainer depending on the case.
20718 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20720 * cs-parser.jay: rework foreach statement to work with the new
20721 changes to the policy on SimpleNames.
20723 * report.cs: support Stacktrace on warnings as well.
20725 * makefile: drop --unsafe and /unsafe from the compile.
20727 2002-03-13 Ravi Pratap <ravi@ximian.com>
20729 * ecore.cs (StandardConversionExists): Modify to take an Expression
20730 as the first parameter. Ensure we do null -> reference type conversion
20733 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20734 temporary Expression objects.
20736 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20738 * interface.cs: workaround bug in method overloading resolution
20739 (there is already a bugzilla bug for it).
20741 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20743 We could also solve this problem by having a separate path for
20744 performing type lookups, instead of DoResolve, we could have a
20745 ResolveType entry point, and only participating pieces of the
20746 production (simplename, deref, array) would implement this.
20748 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20749 signal SimpleName to only resolve type names and not attempt to
20750 resolve anything else.
20752 * expression.cs (Cast): Set the flag.
20754 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20756 * class.cs: Only report 108 if there is no `new' modifier.
20758 * cs-parser.jay: rework foreach statement to work with the new
20759 changes to the policy on SimpleNames.
20761 * report.cs: support Stacktrace on warnings as well.
20763 * makefile: drop --unsafe and /unsafe from the compile.
20765 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20767 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20768 lookups here, instead of doing that at parse time. This means
20769 that our grammar will not introduce `LocalVariableReferences' as
20770 expressions at this point. That solves the problem of code like
20774 static void Main ()
20778 This is only half the fix. The full fix requires parameters to
20779 also be handled in this way.
20781 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20782 makes the use more obvious of the DeclSpace. The
20783 ec.TypeContainer.TypeBuilder is now only used to pull the
20784 TypeBuilder for it.
20786 My theory is that I can get rid of the TypeBuilder completely from
20787 the EmitContext, and have typecasts where it is used (from
20788 DeclSpace to where it matters).
20790 The only pending problem is that the code that implements Aliases
20791 is on TypeContainer, and probably should go in DeclSpace.
20793 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20794 lookups here, instead of doing that at parse time. This means
20795 that our grammar will not introduce `LocalVariableReferences' as
20796 expressions at this point. That solves the problem of code like
20800 static void Main ()
20804 This is only half the fix. The full fix requires parameters to
20805 also be handled in this way.
20807 * class.cs (Property.DefineMethod): When implementing an interface
20808 method, set newslot, when implementing an abstract method, do not
20809 set the flag (before we tried never setting it, or always setting
20810 it, which is the difference).
20811 (Indexer.DefineMethod): same.
20812 (Method.DefineMethod): same.
20814 * ecore.cs: Only set the status used flag if we get back a Field.
20816 * attribute.cs: Temporary hack, so Paolo can keep working.
20818 2002-03-08 Ravi Pratap <ravi@ximian.com>
20820 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20821 the unmanaged type in the case we have a MarshalAs attribute.
20823 (Resolve): Handle the case when we are parsing the special MarshalAs
20824 attribute [we need to store the unmanaged type to use later]
20826 * typemanager.cs (marshal_as_attr_type): Built in type for the
20827 MarshalAs Attribute.
20829 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20830 on parameters and accordingly set the marshalling info.
20832 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20834 * class.cs: Optimizing slightly by removing redundant code after
20835 we switched to the `NoTypes' return value.
20836 (Property.DefineMethod): use NoTypes here too.
20838 This fixes the bug I introduced in my last batch of changes.
20840 2002-03-05 Ravi Pratap <ravi@ximian.com>
20842 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20844 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20845 Enums since those are types too.
20847 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20849 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20850 thanks to a call during the lookup process.
20852 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20854 * statement.cs (Foreach): Lots of work to accomodate a particular
20855 kind of foreach statement that I had not kept in mind. It is
20856 possible to have foreachs on classes that provide a GetEnumerator
20857 method that return objects that implement the "pattern" for using
20858 a foreach, there is no need to support GetEnumerator
20861 This is needed to compile nant.
20863 * decl.cs: Only report 114 if the member is not `Finalize' and if
20864 the warning level is at least 2.
20866 * class.cs: Moved the compare function from Method to
20869 (MethodSignature.InheritableMemberSignatureCompare): Add new
20870 filter function that is used to extract inheritable methods from a
20873 (Method.Define): Use the new `inheritable_method_signature_filter'
20876 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20879 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20881 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20883 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20885 * expression.cs: Pass location information to
20886 ConvertImplicitStandard.
20888 * class.cs: Added debugging code to track return values from
20891 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20893 * expression.cs (Is.DoResolve): If either side of the `is' is an
20894 interface, do not flag the warning.
20896 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20899 * report.cs: Allow for --fatal to be used with --probe.
20901 * typemanager.cs (NoTypes): Move the definition for the empty Type
20904 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20906 (TypeContainer.DefineProxy): New function used to proxy to parent
20907 implementations when implementing interfaces.
20908 (TypeContainer.ParentImplements): used to lookup if our parent
20909 implements a public function that is required by an interface.
20910 (TypeContainer.VerifyPendingMethods): Hook this up.
20912 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20913 `modules' and `assemblies' arraylists into arrays. We only grow
20914 these are the very early start up of the program, so this improves
20915 the speedof LookupType (nicely measured).
20917 * expression.cs (MakeByteBlob): Replaced unsafe code with
20918 BitConverter, as suggested by Paolo.
20920 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20921 folding of string concatenation, but if either side is a string,
20922 and the other is not, then return null, and let the runtime use
20923 the concatenation on the string plus the object (using
20924 `Object.ToString').
20926 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20928 Constant Folding has been implemented now.
20930 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20931 the error instead on types that are not supported in one's
20934 * constant.cs (Constant and all children): New set of functions to
20935 perform implict and explicit conversions.
20937 * ecore.cs (EnumConstant): Implement the new functions to perform
20938 conversion by proxying to the child expression.
20940 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20941 own separate setting that can not be turned off from the command
20942 line using --unchecked or --checked and is only controlled using
20943 the checked/unchecked statements and expressions. This setting is
20944 used by the constant folder to flag errors.
20946 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20947 ConstantCheckState as well.
20949 During Resolve, they also have to flag the state, because the
20950 constant folder runs completely in the Resolve phase.
20952 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20955 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20957 * cfold.cs: New file, this file contains the constant folder.
20959 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20960 argument to track whether we are using the resulting address to
20961 load or store a value and provide better error messages.
20963 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20964 new AddressOf arguments.
20966 * statement.cs (Foreach.EmitCollectionForeach): Update
20968 * expression.cs (Argument.Emit): Call AddressOf with proper
20969 arguments to track usage.
20971 (New.DoEmit): Call AddressOf with new arguments.
20973 (Unary.Emit): Adjust AddressOf call.
20975 2002-03-01 Ravi Pratap <ravi@ximian.com>
20977 * cs-parser.jay (member_access): Change the case for pre-defined types
20978 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20981 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20984 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20985 essentially like methods and apply attributes like MethodImplOptions to them too.
20987 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20990 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20991 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20994 * Update code everywhere accordingly.
20996 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20998 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21000 2002-02-28 Ravi Pratap <ravi@ximian.com>
21002 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21003 try performing lookups against those instead of jumping straight into using
21004 the 'using' clauses.
21006 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21008 (LookupType): Perform lookups in implicit parents too.
21010 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21011 sequence as RootContext.LookupType.
21013 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21014 the various cases of namespace lookups into this method.
21016 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21018 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21019 in positional arguments)
21021 * class.cs (Operator): Update the AllowedModifiers to contain
21024 * cs-parser.jay: Update operator declaration to allow for the
21025 operator body to be empty.
21027 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21030 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21032 * class.cs (Method.Emit): Label parameters.
21034 * driver.cs: Return 1 or 0 as the program exit code.
21036 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21038 * expression.cs: Special case the `null' object when trying to
21039 auto-compute the type, as anything can be explicitly converted to
21042 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21043 spotting this Paolo.
21045 (Expression.ImplicitNumericConversion): Perform comparissions of
21046 the type using the underlying type in the case of an enumeration
21047 rather than using the enumeration type for the compare.
21049 Cope with the underlying == type case, which is not possible to
21052 (Expression.ConvertNumericExplicit): Perform comparissions of
21053 the type using the underlying type in the case of an enumeration
21054 rather than using the enumeration type for the compare.
21056 * driver.cs: If the user does not supply an extension, assume .exe
21058 * cs-parser.jay (if_statement): Rewrote so that we can track the
21059 location for the if statement.
21061 * expression.cs (Binary.ConstantFold): Only concat strings when
21062 the operation is "+", not everything ;-)
21064 * statement.cs (Statement.EmitBoolExpression): Take a location
21066 (If, While, Do): Track location.
21068 * expression.cs (Binary.ResolveOperator): In the object + string
21069 case, I was missing a call to ConvertImplicit
21071 2002-02-25 Ravi Pratap <ravi@ximian.com>
21073 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21074 Location arguments. Ensure we use RootContext.LookupType to do our work
21075 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21077 * interface.cs (PopulateMethod): Handle the type of the parameter being
21080 * expression.cs (Invocation.BetterFunction): Handle the case when we
21081 have a params method with no fixed arguments and a call is made with no
21084 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21086 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21087 the verbatim-string-literal
21089 * support.cs (InternalParameters.ParameterModifier): handle null
21091 (InternalParameters.ParameterType): ditto.
21093 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21094 duplicating the name of the variable parameter.
21095 (GetParameterByName): Fix bug where we were not looking up array
21096 paramters if they were the only present (thanks Paolo!).
21097 (GetParameterInfo): We only have an empty set of types if both
21098 fixed and array are set to null.
21099 (GetParameterInfo-idx): Handle FixedParameter == null
21101 * cs-parser.jay: Handle the case where there is no catch
21102 statements (missing null test).
21104 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21106 * driver.cs (MainDriver): Be conservative on our command line
21109 Catch DirectoryNotFoundException when calling GetFiles.
21111 (SplitPathAndPattern): Used to split the input specification into
21112 a path and a pattern that we can feed to Directory.GetFiles.
21114 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21116 * statement.cs (Fixed): Implement the last case of the Fixed
21117 statement (string handling).
21119 * expression.cs (StringPtr): New class used to return a char * to
21120 a string; Used by the Fixed statement.
21122 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21124 * expression.cs (Binary.ResolveOperator): Remove redundant
21125 MemberLookup pn parent type.
21126 Optimize union call, we do not need a union if the types are the same.
21127 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21130 Specialize the use of MemberLookup everywhere, instead of using
21131 the default settings.
21133 (StackAlloc): Implement stackalloc keyword.
21135 * cs-parser.jay: Add rule to parse stackalloc.
21137 * driver.cs: Handle /h, /help, /?
21139 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21140 before we supported unsafe code.
21142 * makefile: add --unsafe to the self compilation of mcs.
21144 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21146 * expression.cs (PointerArithmetic): New class that is used to
21147 perform pointer arithmetic.
21148 (Binary.Resolve): Handle pointer arithmetic
21149 Handle pointer comparission.
21150 (ArrayPtr): Utility expression class that is used to take the
21151 address of an array.
21153 (ElementAccess): Implement array access for pointers
21155 * statement.cs (Fixed): Implement fixed statement for arrays, we
21156 are missing one more case before we are done.
21158 * expression.cs (Indirection): Implement EmitAssign and set the
21159 ExprClass to Variable. This allows pointer dereferences to be
21160 treated as variables, and to have values assigned to them.
21162 * ecore.cs (Expression.StoreFromPtr): New utility function to
21163 store values dereferencing.
21165 2002-02-20 Ravi Pratap <ravi@ximian.com>
21167 * expression.cs (Binary.ResolveOperator): Ensure that we are
21168 not trying to operate on a void type - this fixes the reported
21171 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21172 the parent implementation is sealed.
21174 * ../errors/cs0239.cs : Add.
21176 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21178 * typemanager.cs (unverifiable_code_type): Corresponds to
21179 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21180 which have unsafe code in them.
21182 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21185 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21187 * cs-tokenizer.cs: Add support for @"litreal strings"
21189 Make tokenizer accept pre-processor directives
21190 on any column (remove the old C-like limitation).
21192 * rootcontext.cs (EmitCode): Emit any global attributes.
21193 (AddGlobalAttributes): Used to keep track of assembly attributes.
21195 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21197 * cs-parser.jay: Add support for global attributes.
21199 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21201 * expression.cs (Indirection): New helper class. Unary will
21202 create Indirection classes to be able to implement the
21203 IMemoryLocation interface on it.
21205 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21207 * cs-parser.jay (fixed_statement): reference the right statement.
21209 * statement.cs (Fixed.Emit): Finish implementing the fixed
21210 statement for the &x case.
21212 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21214 * class.cs (Property.Define, Method.Define): Remove newslot when
21217 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21218 wrong. NewSlot should only be used if the `new' keyword is present.
21220 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21221 locating our system dir. Sorry about this.
21223 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21225 * driver.cs (GetSystemDir): Compute correctly the location of our
21226 system assemblies. I was using the compiler directory instead of
21227 the library directory.
21229 2002-02-13 Ravi Pratap <ravi@ximian.com>
21231 * expression.cs (BetterFunction): Put back in what Miguel commented out
21232 since it is the correct fix. The problem is elsewhere ;-)
21234 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21235 parameters of the parms method are themselves compatible or not !
21237 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21238 to check that a class implements an interface before saying that an implicit
21239 conversion was allowed. Use ImplementsInterface to do the checking.
21241 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21243 * class.cs (Method.Define): Track whether we are an explicit
21244 implementation or not. And only call DefineMethodOverride if we
21245 are an explicit implementation.
21247 (Property.DefineMethod): Ditto.
21249 2002-02-11 Ravi Pratap <ravi@ximian.com>
21251 * expression.cs (BetterFunction): Catch hideous bug which was
21252 preventing us from detecting ambiguous calls due to implicit casts i.e
21255 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21257 * support.cs (Pair): Remove un-needed method. I figured why I was
21258 getting the error in cs-parser.jay, the variable in a foreach loop
21259 is readonly, and the compiler does not really treat this as a variable.
21261 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21262 instead of EQUALS in grammar.
21264 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21266 * expression.cs (Unary.DoResolve): Check whether the argument is
21269 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21271 * support.cs: Api for Pair to set a value. Despite the fact that
21272 the variables are public the MS C# compiler refuses to compile
21273 code that accesses the field if the variable is part of a foreach
21276 * statement.cs (Fixed): Begin implementation of the fixed
21279 (Block.AddVariable): Return the VariableInfo on success and null
21280 on failure instead of true/false.
21282 * cs-parser.jay (foreach): Catch errors on variables already
21283 defined (we were ignoring this value before) and properly unwind
21284 the block hierarchy
21286 (fixed_statement): grammar for the fixed statement.
21288 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21290 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21291 pointer types to be incretemented.
21293 (SizeOf): Implement.
21295 * cs-parser.jay (pointer_member_access): Implement
21296 expr->IDENTIFIER production.
21298 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21299 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21302 (Unary): Implement indirection.
21304 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21305 use in non-unsafe context).
21307 (SimpleName.DoResolve): Check for pointers in field access on safe
21310 (Expression.LoadFromPtr): Factor the load-indirect code in this
21311 function. This was duplicated in UnboxCast and ParameterReference
21313 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21315 * expression.cs (ComposedCast): report an error if a pointer cast
21316 is used in a safe region.
21318 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21319 pointer type casts in unsafe context.
21321 * codegen.cs (EmitContext): Set up IsUnsafe.
21323 * cs-parser.jay (non_expression_type): Add productions for pointer
21326 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21327 code. We should not use force into static mode if the method is
21328 not virtual. Fixes bug in MIS
21330 * statement.cs (Do.Emit, While.Emit, For.Emit,
21331 Statement.EmitBoolExpression): Add support to Do and While to
21332 propagate infinite loop as `I do return' semantics.
21334 Improve the For case to also test for boolean constants.
21336 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21337 to the list of attributes we can add.
21339 Remove `EmitContext' argument.
21341 * class.cs (Method.Define): Apply parameter attributes.
21342 (Constructor.Define): Apply parameter attributes.
21343 (MethodCore.LabelParameters): Move here the core of labeling
21346 * support.cs (ReflectionParameters.ParameterModifier,
21347 InternalParameters.ParameterModifier): Use IsByRef on the type and
21348 only return the OUT bit for these parameters instead of in/out/ref
21351 This is because I miss-understood things. The ParameterInfo.IsIn
21352 and IsOut represent whether the parameter has the [In] and [Out]
21355 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21357 * ecore.cs (FieldExpr.Emit): Release temporaries.
21359 * assign.cs (LocalTemporary.Release): new function.
21361 * codegen.cs (EmitContext.GetTemporaryStorage,
21362 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21363 temporary storage. Now we can "put back" localbuilders when we
21366 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21368 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21369 need to make a copy of the variable to generate verifiable code.
21371 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21373 * driver.cs: Compute dynamically the system directory.
21375 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21376 Slower, but more generally useful. Used by the abstract
21377 registering implementation.
21379 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21380 the rules for the special rule on Type/instances. First check if
21381 we have the same name, and if so, try that special static path
21382 rather than the instance path.
21384 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21386 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21389 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21390 Enum, ValueType, Delegate or Array for non-corlib compiles.
21392 * cs-tokenizer.cs: Catch long identifiers (645)
21394 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21397 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21398 fix, we were returning too early, so we were not registering
21399 pending methods from abstract classes.
21401 Do not register pending methods if the class is abstract.
21403 * expression.cs (Conditional.DoResolve): Report circular implicit
21404 conversions when we neecd to compute it for conditional
21407 (Is.DoResolve): If the expression is always of the provided type,
21408 flag warning 183. If the expression can not ever be of the
21409 provided type flag warning 184.
21411 * class.cs: Catch 169 as well.
21413 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21416 2002-01-18 Nick Drochak <ndrochak@gol.com>
21418 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21420 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21422 * interface.cs: (PopulateMethod): Check for pointers being defined
21423 only if the unsafe context is active.
21424 (PopulateProperty): ditto.
21425 (PopulateIndexer): ditto.
21427 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21428 specified. If pointers are present, make sure that they are
21429 present in an unsafe context.
21430 (Constructor, Constructor.Define): ditto.
21431 (Field, Field.Define): ditto.
21432 (Property, Property.Define): ditto.
21433 (Event, Event.Define): ditto.
21435 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21436 hashtable if there are classes or structs defined.
21438 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21439 code, as the constant resolution moved.
21441 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21442 the metadata, so we can flag error 133.
21444 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21445 pointer is being declared in an unsafe context.
21447 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21449 * modifiers.cs (Modifiers.Check): Require a Location argument.
21450 Report error 227 for Unsafe use.
21452 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21454 * statement.cs (For.Emit): If the test is null, then report that
21455 we do `return', as we wont reach anything afterwards.
21457 (Switch.SwitchGoverningType): Track the expression that matched
21460 * driver.cs: Allow negative numbers as an error code to flag.
21462 * cs-parser.jay: Handle 1551.
21464 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21466 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21468 * cs-parser.jay: Report 1518 (type declaration can only contain
21469 class, struct, interface, enum or delegate)
21471 (switch_label): Report 1523 (keywords `case' or `default' must
21474 (opt_switch_sections): Report 1522 (empty switch)
21476 * driver.cs: Report 1515 (response file specified multiple times)
21477 Report 1516 (Source file specified multiple times).
21479 * expression.cs (Argument.Resolve): Signal 1510
21481 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21482 access not allowed in static code)
21484 2002-01-11 Ravi Pratap <ravi@ximian.com>
21486 * typemanager.cs (IsPointerType): Utility method which we are going
21489 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21490 the object type, so we take care of that.
21492 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21494 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21495 added to non-params parameters :-)
21497 * typemanager.cs (CSharpName): Include 'void' type too.
21499 (void_ptr_type): Include in the set of core types.
21501 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21504 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21507 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21508 completely forgotten about it.
21510 2002-01-10 Ravi Pratap <ravi@ximian.com>
21512 * cs-parser.jay (pointer_type): Add. This begins our implementation
21513 of parsing rules for unsafe code.
21515 (unsafe_statement): Implement.
21517 (embedded_statement): Modify to include the above.
21519 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21521 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21522 if the current context is an unsafe one.
21524 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21525 are handled differently, we need separate rules for them.
21527 (local_variable_declaration): Update to use local_variable_pointer_type
21528 to allow variable declarations of unmanaged pointer types.
21530 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21531 in unsafe contexts.
21533 * ../errors/cs0214.cs : Add.
21535 2002-01-16 Nick Drochak <ndrochak@gol.com>
21537 * makefile: remove 'response' file when cleaning.
21539 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21541 * cs-parser.jay: Report 1524.
21543 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21545 * typemanager.cs (RegisterMethod): drop checking if we have
21546 registered this from here
21548 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21550 * class.cs (Method.EmitDestructor): Implement calling our base
21553 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21554 value of InFinally.
21556 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21557 this routine and will wrap the call in a try/catch block. Deal
21560 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21562 * ecore.cs (Expression.MemberLookup): instead of taking a
21563 parameter `same_type' that was used to tell whether we could
21564 access private members we compute our containing type from the
21567 (FieldExpr): Added partial support for volatile fields. This does
21568 not work for volatile fields exposed from assemblies, as I can not
21569 figure out how to extract the modreq from it.
21571 Updated all the source files to use this.
21573 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21574 because it is referenced by MemberLookup very often.
21576 2002-01-09 Ravi Pratap <ravi@ximian.com>
21578 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21579 TypeBuilder.GetCustomAttributes to retrieve what we need.
21581 Get rid of redundant default_member_attr_type as this is the same as
21582 default_member_type which already exists.
21584 * interface.cs, attribute.cs : Update accordingly.
21586 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21588 * typemanager.cs: Enable IndexerPropertyName again. It does not
21589 work for TYpeBuilders though. Ravi, can you please fix this?
21591 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21593 * expression.cs (Argument.Emit): Handle the case of ref objects
21594 being passed to ref functions;
21596 (ParameterReference.EmitLoad): Loads the content of the pointer
21597 without dereferencing.
21599 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21601 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21603 2002-01-08 Ravi Pratap <ravi@ximian.com>
21605 * class.cs (Indexer.DefineMethod): Incorporate the interface
21606 type in the name of the method if we are doing explicit interface
21609 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21611 (BetterConversion): Fix extremely trivial bug where we were referring to
21612 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21615 * ../errors/bug16.cs : Add although we have fixed it.
21617 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21619 * expression.cs (BaseIndexer): Begin implementation.
21621 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21623 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21624 production directly to remove a shift/reduce, and implement
21625 explicit interface implementation.
21627 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21628 after a floating point suffix.
21630 * expression.cs (DoNumericPromotions): Improved the conversion for
21631 uint/uint. If we have a constant, we avoid doing a typecast to a
21634 * class.cs (Indexer): Implement explicit interface implementation
21637 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21639 * class.cs: make the default instance constructor public and hidebysig.
21641 2001-01-03 Ravi Pratap <ravi@ximian.com>
21643 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21644 so we can call it from elsewhere.
21646 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21647 we emit it internally if the class has a defined indexer; otherwise the user
21648 emits it by decorating the class definition with the DefaultMemberAttribute.
21650 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21651 attribute is not used on a type which defines an indexer.
21653 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21654 character when we skip whitespace.
21656 * ../errors/cs0646.cs : Add.
21658 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21660 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21663 * makefile: Add practical target `mcs3.exe' which builds the third
21664 generation compiler.
21666 * expression.cs (New): Fix structures constructor calling.
21668 * class.cs (Property, Method, Indexer): Emit Final flag on the
21669 method if we are an interface implementation and we are not
21672 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21673 whether this property is referencing a `base' method.
21675 * expression.cs (Invocation.EmitCall): take an extra argument:
21676 is_base, this is used to determine whether the `call' or
21677 `callvirt' opcode should be used.
21680 * delegate.cs: update EmitCall.
21682 * class.cs (Method.Define): Set NewSlot for the cases where we are
21683 not implementing an interface method.
21685 (Property.Define): ditto.
21687 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21689 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21690 'r'. Allows mcs to parse itself fully.
21692 2002-01-02 Ravi Pratap <ravi@ximian.com>
21694 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21695 of the number of initializers that require the InitializeArray method.
21697 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21698 update the above field where necessary.
21700 (MakeByteBlob): Update accordingly.
21702 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21705 (EmitDynamicInitializers): Update in accordance with the new optimization.
21707 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21708 same OpCode applies.
21710 * cs-parser.jay : Fix some glaring errors I introduced.
21712 2002-01-01 Ravi Pratap <ravi@ximian.com>
21714 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21715 so that we can check for name clashes there too.
21717 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21718 for interface indexers.
21720 * interfaces.cs (Define): Emit the default member attribute.
21722 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21723 variable was being referred to while setting the value ;-)
21725 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21727 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21728 byte-by-byte information when we know the data is zero.
21730 Make the block always a multiple of 4, because
21731 DefineInitializedData has a bug.
21733 * assign.cs: Fix, we should assign from the temporary, not from
21736 * expression.cs (MakeByteBlob): Fix my incorrect code.
21738 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21740 * typemanager.cs (EnumToUnderlying): This function is used to get
21741 the underlying type from an enumeration, because it does not
21744 * constant.cs: Use the I4_S form for values between -128 and 127.
21746 * statement.cs (Block.LookupLabel): Looks up a label.
21747 (Block): Drop support for labeled blocks.
21749 (LabeledStatement): New kind of statement that represents a label
21752 (Goto): Finally implement this bad boy.
21754 * cs-parser.jay: Update to reflect new mechanism to implement
21757 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21759 * codegen.cs (EmitContext.This): a codegen property that keeps the
21760 a single instance of this instead of creating many different this
21763 * delegate.cs (Delegate.DoResolve): Update to use the property;
21765 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21767 * expression.cs (BaseAccess.DoResolve): Ditto.
21769 2001-12-29 Ravi Pratap <ravi@ximian.com>
21771 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21772 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21774 (InitCoreTypes): Update accordingly.
21776 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21777 so we can quickly store the state.
21779 (ApplyAttributes): Set the correct implementation flags
21780 for InternalCall methods.
21782 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21784 * expression.cs (EmitCall): if a method is not virtual, then do
21785 not use callvirt on it.
21787 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21788 user defined stuff) requires the use of stobj, which takes an
21789 address on the stack instead of an array and an index. So emit
21790 the Ldelema operation for it.
21792 (EmitStoreOpcode): Use stobj for valuetypes.
21794 (UnaryMutator.EmitCode): Use the right 1 value depending on
21795 whether we are dealing with int64/uint64, float or doubles.
21797 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21798 constructors that I implemented last night.
21800 (Constructor.IsDefault): Fix to work properly for static
21803 * cs-parser.jay (CheckDef): report method signature errors.
21804 Update error number 103 to be 132.
21806 * decl.cs: New AdditionResult enumeration value: MethodExists.
21807 Although we do this check for methods later on in the semantic
21808 analysis, catching repeated default constructors is so easy that
21809 we catch these here.
21811 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21814 (ParameterReference.EmitAssign, Emit): handle
21817 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21818 (ArrayAccess.EmitStoreOpcode): ditto.
21820 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21822 * expression.cs (MakeByteBlob): Complete all the missing types
21823 (uint, short, ushort, byte, sbyte)
21825 * class.cs: Only init instance field initializers on instance
21828 Rename `constructors' to instance_constructors.
21830 (TypeContainer.AddConstructor): Only add constructors to the list
21831 if it is not static.
21833 Make sure that we handle default_static_constructor independently
21834 everywhere where we handle instance_constructors
21836 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21838 * class.cs: Do not lookup or create a base initializer for a
21839 static constructor.
21841 (ConstructorInitializer.Resolve): use the proper type to lookup
21844 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21846 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21849 * decl.cs: CloseType is now an virtual method, the default
21850 implementation just closes this type.
21852 2001-12-28 Ravi Pratap <ravi@ximian.com>
21854 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21855 to PreserveSig by default. Also emit HideBySig on such methods.
21857 Basically, set the defaults to standard values.
21859 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21860 argument, if candidate is better, it can't be worse than the best !
21862 (Invocation): Re-write bits to differentiate between methods being
21863 applicable in their expanded form and their normal form - for params
21866 Get rid of use_standard everywhere as only standard conversions are allowed
21867 in overload resolution.
21869 More spec conformance.
21871 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21873 * driver.cs: Add --timestamp, to see where the compiler spends
21876 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21877 `this' in static code.
21879 (SimpleName.DoResolve): Implement in terms of a helper function
21880 that allows static-references to be passed upstream to
21883 (Expression.ResolveWithSimpleName): Resolve specially simple
21884 names when called by MemberAccess to implement the special
21887 (Expression.ImplicitReferenceConversion): Handle conversions from
21888 Null to reference types before others, as Null's type is
21891 * expression.cs (Invocation.EmitCall): Handle the special case of
21892 calling methods declared on a reference type from a ValueType
21893 (Base classes System.Object and System.Enum)
21895 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21896 the left hand side is a TypeExpr, not on every enumeration.
21898 (Binary.Resolve): If types are reference types, then do a cast to
21899 object on operators != and == of both arguments.
21901 * typemanager.cs (FindMembers): Extract instance and static
21902 members if requested.
21904 * interface.cs (PopulateProperty): Use void_type instead of null
21905 as the return type for the setter method.
21907 (PopulateIndexer): ditto.
21909 2001-12-27 Ravi Pratap <ravi@ximian.com>
21911 * support.cs (ReflectionParameters): Fix minor bug where we
21912 were examining the wrong parameter for the ParamArray attribute.
21914 Cope with requests for the type of the parameter at position
21915 greater than the params parameter's. We now return the element
21916 type of the params array as that makes more sense.
21918 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21919 accordingly as we no longer have to extract the element type
21922 (Invocation.OverloadResolve): Update.
21924 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21926 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21927 against IEnumerator, test whether the return value is a descendant
21928 of the IEnumerator interface.
21930 * class.cs (Indexer.Define): Use an auxiliary method to implement
21931 the other bits of the method definition. Begin support for
21932 explicit interface implementation.
21934 (Property.DefineMethod): Use TypeManager.void_type instead of null
21935 for an empty return value.
21937 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21939 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21940 dealing with a FieldExpr which is composed of a FieldBuilder, in
21941 the code path we did extract the constant, but we should have
21942 obtained the underlying value to be able to cast it (otherwise we
21943 end up in an infinite loop, this is what Ravi was running into).
21945 (ArrayCreation.UpdateIndices): Arrays might be empty.
21947 (MemberAccess.ResolveMemberAccess): Add support for section
21948 14.5.4.1 that deals with the special case of E.I when E is a type
21949 and something else, that I can be a reference to a static member.
21951 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21952 handle a particular array type to create byte blobs, it is just
21953 something we dont generate byteblobs for.
21955 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21958 * location.cs (Push): remove the key from the hashtable that we
21959 are about to add. This happens for empty files.
21961 * driver.cs: Dispose files after we have parsed them.
21963 (tokenize): new function that only runs the tokenizer on its
21964 input, for speed testing.
21966 2001-12-26 Ravi Pratap <ravi@ximian.com>
21968 * class.cs (Event.Define): Define the private field only if there
21969 are no accessors defined.
21971 * expression.cs (ResolveMemberAccess): If there is no associated
21972 field with the event, that means we have an event defined with its
21973 own accessors and we should flag error cs0070 since transforming
21974 ourselves into a field is not valid in that case.
21976 * ecore.cs (SimpleName.DoResolve): Same as above.
21978 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21979 and charset to sane values.
21981 2001-12-25 Ravi Pratap <ravi@ximian.com>
21983 * assign.cs (DoResolve): Perform check on events only if they
21984 are being accessed outside the declaring type.
21986 * cs-parser.jay (event_declarations): Update rules to correctly
21987 set the type of the implicit parameter etc.
21989 (add_accessor, remove_accessor): Set current local parameters.
21991 * expression.cs (Binary): For delegate addition and subtraction,
21992 cast the return value from the method into the appropriate delegate
21995 2001-12-24 Ravi Pratap <ravi@ximian.com>
21997 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21998 of these as the workaround is unnecessary.
22000 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22001 delegate data - none of that is needed at all.
22003 Re-write bits to extract the instance expression and the delegate method
22006 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22009 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22010 of attaching attributes instead of duplicating code everywhere.
22012 * everywhere : Update code to do attribute emission using the above method.
22014 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22016 * expression.cs (IsParamsMethodApplicable): if there are not
22017 parameters, return immediately.
22019 * ecore.cs: The 0 literal can be implicity converted to an enum
22022 (SimpleName.DoResolve): First lookup the type, then lookup the
22025 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22026 want to get its address. If the InstanceExpression is not
22027 addressable, store the result in a temporary variable, then get
22030 * codegen.cs: Only display 219 errors on warning level or above.
22032 * expression.cs (ArrayAccess): Make it implement the
22033 IMemoryLocation interface.
22035 (Binary.DoResolve): handle the operator == (object a, object b)
22036 and operator != (object a, object b) without incurring into a
22037 BoxedCast (because 5 != o should never be performed).
22039 Handle binary enumerator operators.
22041 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22042 value type, otherwise use Ldelem_ref.
22044 Use precomputed names;
22046 (AddressOf): Implement address of
22048 * cs-parser.jay (labeled_statement): Fix recursive block
22049 addition by reworking the production.
22051 * expression.cs (New.DoEmit): New has a special case:
22053 If we are dealing with a ValueType, we have a few
22054 situations to deal with:
22056 * The target of New is a ValueType variable, that is
22057 easy, we just pass this as the variable reference
22059 * The target of New is being passed as an argument,
22060 to a boxing operation or a function that takes a
22063 In this case, we need to create a temporary variable
22064 that is the argument of New.
22067 2001-12-23 Ravi Pratap <ravi@ximian.com>
22069 * rootcontext.cs (LookupType): Check that current_type is not null before
22070 going about looking at nested types.
22072 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22073 not implement the IAssignMethod interface any more.
22075 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22076 where we tranform them into FieldExprs if they are being resolved from within
22077 the declaring type.
22079 * ecore.cs (SimpleName.DoResolve): Do the same here.
22081 * assign.cs (DoResolve, Emit): Clean up code considerably.
22083 * ../errors/bug10.cs : Add.
22085 * ../errors/cs0070.cs : Add.
22087 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22089 * assign.cs : Get rid of EventIsLocal everywhere.
22091 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22093 * ecore.cs (ConvertIntLiteral): finished the implementation.
22095 * statement.cs (SwitchLabel): Convert the value we are using as a
22096 key before looking up the table.
22098 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22100 * codegen.cs (EmitTopBlock): Require a Location argument now.
22102 * cs-parser.jay (constructor_declarator): We need to setup
22103 current_local_parameters before we parse the
22104 opt_constructor_initializer, to allow the variables to be bound
22105 to the constructor arguments.
22107 * rootcontext.cs (LookupType): First lookup nested classes in our
22108 class and our parents before we go looking outside our class.
22110 * expression.cs (ConstantFold): Extract/debox the values at the
22113 * rootcontext.cs (EmitCode): Resolve the constants first before we
22114 resolve the types. This is not really needed, but it helps debugging.
22116 * statement.cs: report location.
22118 * cs-parser.jay: pass location to throw statement.
22120 * driver.cs: Small bug fix.
22122 * report.cs: Updated format to be 4-zero filled digits.
22124 2001-12-22 Ravi Pratap <ravi@ximian.com>
22126 * expression.cs (CheckIndices): Fix minor bug where the wrong
22127 variable was being referred to ;-)
22129 (DoEmit): Do not call EmitStaticInitializers when the
22130 underlying type is System.Object.
22132 2001-12-21 Ravi Pratap <ravi@ximian.com>
22134 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22135 and do the usual workaround for SRE.
22137 * class.cs (MyEventBuilder.EventType): New member to get at the type
22138 of the event, quickly.
22140 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22142 * assign.cs (Assign.DoResolve): Handle the case when the target
22143 is an EventExpr and perform the necessary checks.
22145 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22148 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22150 (EventExpr): Set the type in the constructor itself since we
22151 are meant to be born fully resolved.
22153 (EventExpr.Define): Revert code I wrote earlier.
22155 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22156 instance expression is null. The instance expression is a This in that case
22157 or a null, depending on whether it is a static method or not.
22159 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22160 refers to more than one method.
22162 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22163 and accordingly flag errors.
22165 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22167 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22169 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22171 * location.cs (ToString): Provide useful rutine.
22173 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22175 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22176 objects, return the actual integral boxed.
22178 * statement.cs (SwitchLabel): define an ILLabel for each
22181 (Switch.CheckSwitch): If the value is a Literal, extract
22182 the underlying literal.
22184 Also in the unused hashtable we had, add the SwitchLabel so we can
22185 quickly look this value up.
22187 * constant.cs: Implement a bunch of new constants. Rewrite
22188 Literal based on this. Made changes everywhere to adapt to this.
22190 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22191 dereferencing array only once, and also copes with enumrations.
22193 bytes are two bytes wide, not one.
22195 (Cast): Perform constant conversions.
22197 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22198 wrappers to the literals here.
22200 * expression.cs (DoNumericPromotions): long literals can converted
22201 to ulong implicity (this is taken care of elsewhere, but I was
22202 missing this spot).
22204 * ecore.cs (Expression.Literalize): Make the return type Literal,
22205 to improve type checking.
22207 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22209 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22211 * literal.cs: Revert code from ravi that checked the bounds. The
22212 bounds are sane by the definition of the type itself.
22214 * typemanager.cs: Fix implementation of ImplementsInterface. We
22215 need to actually look up in our parent hierarchy for interfaces
22218 * const.cs: Use the underlying type for enumerations
22220 * delegate.cs: Compute the basename for the delegate creation,
22221 that should fix the delegate test case, and restore the correct
22222 Type Lookup semantics in rootcontext
22224 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22225 referencing a nested type with the Reflection API is using the "+"
22228 * cs-parser.jay: Do not require EOF token at the end.
22230 2001-12-20 Ravi Pratap <ravi@ximian.com>
22232 * rootcontext.cs (LookupType): Concatenate type names with
22233 a '.' instead of a '+' The test suite passes again.
22235 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22236 field of the enumeration.
22238 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22239 the case when the member is an EventExpr.
22241 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22242 static has an associated instance expression.
22244 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22246 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22248 * class.cs (Event.Define): Register event and perform appropriate checks
22251 We define the Add and Remove methods even if the use provides none because
22252 in that case, we provide default implementations ourselves.
22254 Define a private field of the type of the event. This is done by the CSC compiler
22255 and we should be doing it too ;-)
22257 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22258 More methods we use in code we generate.
22260 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22263 (InitCoreTypes): Update accordingly for the above.
22265 * class.cs (Event.Emit): Generate code for default accessors that we provide
22267 (EmitDefaultMethod): Do the job in the above.
22269 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22272 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22274 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22275 builders even if we were missing one.
22277 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22278 pass the Basename as our class name instead of the Name. The
22279 basename will be correctly composed for us.
22281 * parameter.cs (Paramters): Now takes a Location argument.
22283 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22284 make all the code call directly LookupType in RootContext and take
22285 this chance to pass the Location information everywhere.
22287 * Everywhere: pass Location information.
22289 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22291 * class.cs (Constructor.Define): Updated way of detecting the
22292 length of the parameters.
22294 (TypeContainer.DefineType): Use basename as the type name for
22297 (TypeContainer.Define): Do not recursively define types here, as
22298 definition is taken care in order by the RootContext.
22300 * tree.cs: Keep track of namespaces in a per-file basis.
22302 * parameter.cs (Parameter.ComputeSignature): Update to use
22305 (Parameters.GetSignature): ditto.
22307 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22308 instead of a TypeContainer.
22310 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22311 resolve names. Because we need to be resolve in our context, not
22314 * driver.cs: Implement response files.
22316 * class.cs (TypeContainer.DefineType): If we are defined, do not
22317 redefine ourselves.
22319 (Event.Emit): Emit the code for add/remove handlers.
22320 (Event.Define): Save the MethodBuilders for add/remove.
22322 * typemanager.cs: Use pair here too.
22324 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22325 DictionaryEntry requires the first argument to be non-null.
22327 (enum_declaration): Compute full name for registering the
22330 (delegate_declaration): Instead of using
22331 formal_parameter_list, use opt_formal_parameter_list as the list
22334 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22335 (EventParsing): New property that controls whether `add' and
22336 `remove' are returned as tokens or identifiers (for events);
22338 2001-12-19 Ravi Pratap <ravi@ximian.com>
22340 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22341 use MyEventBuilder only and let it wrap the real builder for us.
22343 (MyEventBuilder): Revamp constructor etc.
22345 Implement all operations that we perform on EventBuilder in precisely the same
22348 (FindMembers): Update to use the EventBuilder member.
22350 (Event.Emit): Update accordingly.
22352 2001-12-18 Ravi Pratap <ravi@ximian.com>
22354 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22355 by calling the appropriate methods.
22357 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22360 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22362 2001-12-17 Ravi Pratap <ravi@ximian.com>
22364 * delegate.cs (Delegate.Populate): Check that the return type
22365 and various parameters types are indeed accessible.
22367 * class.cs (Constructor.Define): Same here.
22369 (Field.Define): Ditto.
22371 (Event.Define): Ditto.
22373 (Operator.Define): Check that the underlying Method defined itself
22374 correctly - so it's MethodBuilder should not be null.
22376 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22377 expression happens to be null.
22379 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22380 members but as of now we don't seem to be able to do anything really useful with it.
22382 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22383 not the EventBuilder.
22385 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22387 * cs-tokenizer.cs: Add support for defines.
22388 Add support for #if, #elif, #else, #endif
22390 (eval_var): evaluates a variable.
22391 (eval): stubbed for evaluating functions.
22393 * cs-parser.jay: Pass the defines information
22395 * driver.cs: Add --define command line option.
22397 * decl.cs: Move MemberCore here.
22399 Make it the base class for DeclSpace. This allows us to catch and
22400 report 108 and 109 for everything now.
22402 * class.cs (TypeContainer.Define): Extract all the members
22403 before populating and emit the warning 108 (new keyword required
22404 to override) instead of having each member implement this.
22406 (MemberCore.Define): New abstract method, we will be using this in
22407 the warning reporting engine in Populate.
22409 (Operator.Define): Adjust to new MemberCore protocol.
22411 * const.cs (Const): This does not derive from Expression, it is a
22412 temporary object we use to create fields, it is a MemberCore.
22414 * class.cs (Method.Define): Allow the entry point to be in a
22417 * driver.cs: Rewrite the argument handler to clean it up a bit.
22419 * rootcontext.cs: Made it just an auxiliary namespace feature by
22420 making everything static.
22422 * driver.cs: Adapt code to use RootContext type name instead of
22425 * delegate.cs: Remove RootContext argument.
22427 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22430 * class.cs (Event.Define): The lookup can fail.
22432 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22434 * expression.cs: Resolve the this instance before invoking the code.
22436 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22438 * cs-parser.jay: Add a production in element_access that allows
22439 the thing to become a "type" reference. This way we can parse
22440 things like "(string [])" as a type.
22442 Note that this still does not handle the more complex rules of
22446 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22448 * ecore.cs: (CopyNewMethods): new utility function used to
22449 assemble the list of methods from running FindMembers.
22451 (MemberLookup): Rework FindMembers so that
22453 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22455 * class.cs (TypeContainer): Remove Delegates who fail to be
22458 * delegate.cs (Populate): Verify that we dont get null return
22459 values. TODO: Check for AsAccessible.
22461 * cs-parser.jay: Use basename to emit error 574 (destructor should
22462 have the same name as container class), not the full name.
22464 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22465 possible representation.
22467 Also implements integer type suffixes U and L.
22469 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22471 * expression.cs (ArrayCreation.DoResolve): We need to do the
22472 argument resolution *always*.
22474 * decl.cs: Make this hold the namespace. Hold the root context as
22476 (LookupType): Move here.
22478 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22480 * location.cs (Row, Name): Fixed the code, it was always returning
22481 references to the first file.
22483 * interface.cs: Register properties defined through interfaces.
22485 * driver.cs: Add support for globbing on the command line
22487 * class.cs (Field): Make it derive from MemberCore as well.
22490 2001-12-15 Ravi Pratap <ravi@ximian.com>
22492 * class.cs (Event::Define): Check that the type of the event is a delegate
22493 type else flag error #66.
22495 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22498 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22499 values of EntryPoint, CharSet etc etc.
22501 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22503 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22504 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22505 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22506 which needs this to do its work.
22508 * ../errors/cs0066.cs : Add.
22510 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22512 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22515 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22516 clears out the parameters field.
22517 (MemberSignatureCompare): Cleanup
22519 (MemberCore): New base class used to share code between MethodCore
22522 (RegisterRequiredImplementations) BindingFlags.Public requires
22523 either BindingFlags.Instace or Static. Use instance here.
22525 (Property): Refactored code to cope better with the full spec.
22527 * parameter.cs (GetParameterInfo): Return an empty array instead
22530 * class.cs (Property): Abstract or extern properties have no bodies.
22532 * parameter.cs (GetParameterInfo): return a zero-sized array.
22534 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22535 method modifier validation to the typecontainer so we can reuse
22536 this on properties.
22538 (MethodCore.ParameterTypes): return an empty sized array of types.
22540 (Property.Define): Test property modifier validity.
22542 Add tests for sealed/override too.
22544 (Method.Emit): abstract or extern methods have no bodies.
22546 2001-12-14 Ravi Pratap <ravi@ximian.com>
22548 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22551 (Method::Define, ::Emit): Modify accordingly.
22553 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22555 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22557 * makefile: Pass in /unsafe.
22559 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22561 * class.cs (MakeKey): Kill routine.
22563 * class.cs (TypeContainer.Define): Correctly define explicit
22564 method implementations (they require the full interface name plus
22567 * typemanager.cs: Deply the PtrHashtable here and stop using the
22568 lame keys. Things work so much better.
22570 This of course broke everyone who depended on `RegisterMethod' to
22571 do the `test for existance' test. This has to be done elsewhere.
22573 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22574 the object stupid Equals method (because, that like fails all over
22575 the place). We still do not use it.
22577 * class.cs (TypeContainer.SetRequiredInterface,
22578 TypeContainer.RequireMethods): Killed these two routines and moved
22579 all the functionality to RegisterRequiredImplementations.
22581 (TypeContainer.RegisterRequiredImplementations): This routine now
22582 registers all the implementations required in an array for the
22583 interfaces and abstract methods. We use an array of structures
22584 which can be computed ahead of time to reduce memory usage and we
22585 also assume that lookups are cheap as most classes will not
22586 implement too many interfaces.
22588 We also avoid creating too many MethodSignatures.
22590 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22591 clear the "pending" bit if we find that there are problems with
22594 (TypeContainer.VerifyPendingMethods): Update to report errors of
22595 methods that look like implementations but are not.
22597 (TypeContainer.Define): Add support for explicit interface method
22600 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22602 * typemanager.cs: Keep track of the parameters here instead of
22603 being a feature of the TypeContainer.
22605 * class.cs: Drop the registration of parameters here, as
22606 InterfaceMethods are also interface declarations.
22608 * delegate.cs: Register methods with the TypeManager not only with
22609 the TypeContainer. This code was buggy.
22611 * interface.cs: Full registation here.
22613 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22615 * expression.cs: Remove reducer for binary expressions, it can not
22618 * const.cs: Put here the code that used to go into constant.cs
22620 * constant.cs: Put here the code for constants, this is a new base
22621 class for Literals.
22623 * literal.cs: Make Literal derive from Constant.
22625 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22627 * statement.cs (Return.Emit): Report error 157 if the user
22628 attempts to return from a finally block.
22630 (Return.Emit): Instead of emitting a return, jump to the end of
22633 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22634 LocalBuilder to store the result of the function. ReturnLabel is
22635 the target where we jump.
22638 2001-12-09 Radek Doulik <rodo@ximian.com>
22640 * cs-parser.jay: remember alias in current namespace
22642 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22645 * class.cs (LookupAlias): lookup alias in my_namespace
22647 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22649 (LookupAlias): lookup alias in this and if needed in parent
22652 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22656 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22657 making things static. I need this to avoid passing the
22658 TypeContainer when calling ParameterType.
22660 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22661 that did string manipulation to compute the type and then call
22662 GetType. Use Parameter.ParameterType instead.
22664 * cs-tokenizer.cs: Consume the suffix for floating values.
22666 * expression.cs (ParameterReference): figure out whether this is a
22667 reference parameter or not. Kill an extra variable by computing
22668 the arg_idx during emission.
22670 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22671 function that returns whether a parameter is an out/ref value or not.
22673 (Parameter.ParameterType): The type of the parameter (base,
22674 without ref/out applied).
22676 (Parameter.Resolve): Perform resolution here.
22677 (Parameter.ExternalType): The full type (with ref/out applied).
22679 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22680 support for expressions on the using statement.
22682 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22684 * statement.cs (Using.EmitLocalVariableDecls): Split the
22685 localvariable handling of the using statement.
22687 (Block.EmitMeta): Keep track of variable count across blocks. We
22688 were reusing slots on separate branches of blocks.
22690 (Try.Emit): Emit the general code block, we were not emitting it.
22692 Check the type of the declaration to be an IDisposable or
22693 something that can be implicity converted to it.
22695 Emit conversions if required.
22697 * ecore.cs (EmptyExpression): New utility class.
22698 (Expression.ImplicitConversionExists): New utility function.
22700 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22702 * statement.cs (Using): Implement.
22704 * expression.cs (LocalVariableReference): Support read only variables.
22706 * statement.cs: Remove the explicit emit for the Leave opcode.
22707 (VariableInfo): Add a readonly field.
22709 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22711 * ecore.cs (ConvCast): new class used to encapsulate the various
22712 explicit integer conversions that works in both checked and
22713 unchecked contexts.
22715 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22716 properly generate the overflow opcodes.
22718 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22720 * statement.cs: The correct type for the EmptyExpression is the
22721 element_type, not the variable type. Ravi pointed this out.
22723 2001-12-04 Ravi Pratap <ravi@ximian.com>
22725 * class.cs (Method::Define): Handle PInvoke methods specially
22726 by using DefinePInvokeMethod instead of the usual one.
22728 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22729 above to do the task of extracting information and defining the method.
22731 2001-12-04 Ravi Pratap <ravi@ximian.com>
22733 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22734 of the condition for string type.
22736 (Emit): Move that here.
22738 (ArrayCreation::CheckIndices): Keep string literals in their expression
22741 (EmitDynamicInitializers): Handle strings appropriately.
22743 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22745 * codegen.cs (EmitContext): Replace multiple variables with a
22746 single pointer to the current Switch statement.
22748 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22751 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22755 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22758 (Foreach.Emit): Foreach on arrays was not setting
22759 up the loop variables (for break/continue).
22761 (GotoCase): Semi-implented.
22763 2001-12-03 Ravi Pratap <ravi@ximian.com>
22765 * attribute.cs (CheckAttribute): Handle system attributes by using
22766 Attribute.GetAttributes to examine information we need.
22768 (GetValidPlaces): Same here.
22770 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22772 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22774 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22776 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22778 (Method::Emit): Handle the case when we are a PInvoke method.
22780 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22782 * expression.cs: Use ResolveWithSimpleName on compound names.
22784 2001-12-02 Ravi Pratap <ravi@ximian.com>
22786 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22787 before trying to reduce it.
22789 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22791 * constant.cs (LookupConstantValue): Implement.
22793 (EmitConstant): Use the above in emitting the constant.
22795 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22796 that are user-defined by doing a LookupConstantValue on them.
22798 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22801 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22803 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22805 (BaseAccess.DoResolve): Implement.
22807 (MemberAccess.DoResolve): Split this routine into a
22808 ResolveMemberAccess routine that can be used independently
22810 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22812 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22813 As that share bits of the implementation. Is returns a boolean,
22814 while As returns the Type that is being probed.
22816 2001-12-01 Ravi Pratap <ravi@ximian.com>
22818 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22819 instead of a Literal - much easier.
22821 (EnumInTransit): Remove - utterly useless :-)
22823 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22825 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22827 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22828 chain when we have no associated expression.
22830 2001-11-30 Ravi Pratap <ravi@ximian.com>
22832 * constant.cs (Define): Use Location while reporting the errror.
22834 Also emit a warning when 'new' is used and there is no inherited
22837 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22840 (LookupEnumValue): Implement to lookup an enum member's value and define it
22843 (Populate): Re-write accordingly to use the above routine.
22845 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22847 * expression.cs (This): Fix prototype for DoResolveLValue to
22848 override the base class DoResolveLValue.
22850 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22853 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22854 (we need to load the address of the field here). This fixes
22857 (FieldExpr.DoResolveLValue): Call the DoResolve
22858 function to initialize the Instance expression.
22860 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22861 correctly the GetEnumerator operation on a value type.
22863 * cs-parser.jay: Add more simple parsing error catches.
22865 * statement.cs (Switch): Add support for string switches.
22866 Handle null specially.
22868 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22870 2001-11-28 Ravi Pratap <ravi@ximian.com>
22872 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22874 (declare_local_constant): New helper function.
22876 * statement.cs (AddConstant): Keep a separate record of constants
22878 (IsConstant): Implement to determine if a variable is a constant.
22880 (GetConstantExpression): Implement.
22882 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22884 * statement.cs (IsVariableDefined): Re-write.
22886 2001-11-27 Ravi Pratap <ravi@ximian.com>
22888 * class.cs (TypeContainer::FindMembers): Look for constants
22889 in the case when we are looking for MemberTypes.Field
22891 * expression.cs (MemberAccess::DoResolve): Check that in the
22892 case we are a FieldExpr and a Literal, we are not being accessed
22893 by an instance reference.
22895 * cs-parser.jay (local_constant_declaration): Implement.
22897 (declaration_statement): Implement for constant declarations.
22899 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22901 * statement.cs (Switch): Catch double defaults.
22903 (Switch): More work on the switch() statement
22904 implementation. It works for integral values now, need to finish
22908 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22910 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22911 integer literals into other integer literals. To be used by
22914 2001-11-24 Ravi Pratap <ravi@ximian.com>
22916 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22919 (EmitDynamicInitializers): Cope with the above since we extract data
22920 directly from ArrayData now.
22922 (ExpectInitializers): Keep track of whether initializers are mandatory
22925 (Bounds): Make it a hashtable to prevent the same dimension being
22926 recorded for every element in that dimension.
22928 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22931 Also fix bug which was causing the indices to be emitted in the reverse
22934 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22936 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22937 unfinished. They do not work, because the underlying code is
22940 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22942 * cs-parser.jay: Remove bogus fixme.
22944 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22945 on Switch statement.
22947 2001-11-23 Ravi Pratap <ravi@ximian.com>
22949 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22952 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22953 parameter. Apparently, any expression is allowed.
22955 (ValidateInitializers): Update accordingly.
22957 (CheckIndices): Fix some tricky bugs thanks to recursion.
22959 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22960 I was being completely brain-dead.
22962 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22963 and re-write acordingly.
22965 (DelegateInvocation): Re-write accordingly.
22967 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22969 (MakeByteBlob): Handle types more correctly.
22971 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22972 initialization from expressions but it is incomplete because I am a complete
22975 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22977 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22978 on If. Basically, we have to return `true' (ie, we do return to
22979 our caller) only if both branches of the if return.
22981 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22982 short-circuit operators, handle them as short circuit operators.
22984 (Cast.DoResolve): Resolve type.
22985 (Cast.Cast): Take an expression as the target type.
22987 * cs-parser.jay (cast_expression): Remove old hack that only
22988 allowed a limited set of types to be handled. Now we take a
22989 unary_expression and we resolve to a type during semantic
22992 Use the grammar productions from Rhys to handle casts (this is
22993 not complete like Rhys syntax yet, we fail to handle that corner
22994 case that C# has regarding (-x), but we will get there.
22996 2001-11-22 Ravi Pratap <ravi@ximian.com>
22998 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22999 field which is an array type.
23001 * cs-parser.jay (declare_local_variables): Support array initialization too.
23003 * typemanager.cs (MakeKey): Implement.
23005 (everywhere): Use the above appropriately.
23007 * cs-parser.jay (for_statement): Update for array initialization while
23008 declaring variables.
23010 * ecore.cs : The error message was correct, it's the variable's names that
23011 were misleading ;-) Make the code more readable.
23013 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23014 the correct type etc.
23016 (ConvertExplicit): Handle Enum types by examining the underlying type.
23018 2001-11-21 Ravi Pratap <ravi@ximian.com>
23020 * parameter.cs (GetCallingConvention): Always return
23021 CallingConventions.Standard for now.
23023 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23025 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23026 and `r' after calling DoNumericPromotions.
23028 * ecore.cs: Fix error message (the types were in the wrong order).
23030 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23031 BindingFlags.Instance as well
23033 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23034 implicit int literal conversion in an empty cast so that we
23035 propagate the right type upstream.
23037 (UnboxCast): new class used to unbox value types.
23038 (Expression.ConvertExplicit): Add explicit type conversions done
23041 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23042 the target type before applying the implicit LongLiterals to ULong
23045 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23047 * cs-parser.jay (for_statement): Reworked the way For works: now
23048 we declare manually any variables that are introduced in
23049 for_initializer to solve the problem of having out-of-band code
23050 emition (that is what got for broken).
23052 (declaration_statement): Perform the actual variable declaration
23053 that used to be done in local_variable_declaration here.
23055 (local_variable_declaration): Do not declare anything, just pass
23056 the information on a DictionaryEntry
23058 2001-11-20 Ravi Pratap <ravi@ximian.com>
23060 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23061 re-write of the logic to now make it recursive.
23063 (UpdateIndices): Re-write accordingly.
23065 Store element data in a separate ArrayData list in the above methods.
23067 (MakeByteBlob): Implement to dump the array data into a byte array.
23069 2001-11-19 Ravi Pratap <ravi@ximian.com>
23071 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23074 * constant.cs (Define): Implement.
23076 (EmitConstant): Re-write fully.
23078 Pass in location info.
23080 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23083 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23084 DictionaryEntry since we need location info too.
23086 (constant_declaration): Update accordingly.
23088 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23089 code into another method : UpdateIndices.
23091 2001-11-18 Ravi Pratap <ravi@ximian.com>
23093 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23094 some type checking etc.
23096 2001-11-17 Ravi Pratap <ravi@ximian.com>
23098 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23099 bits to provide dimension info if the user skips doing that.
23101 Update second constructor to store the rank correctly.
23103 2001-11-16 Ravi Pratap <ravi@ximian.com>
23105 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23106 and try to implement.
23108 * ../errors/cs0150.cs : Add.
23110 * ../errors/cs0178.cs : Add.
23112 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23114 * statement.cs: Implement foreach on multi-dimensional arrays.
23116 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23117 name of the params argument.
23119 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23120 initializing the array.
23122 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23123 we can use this elsewhere.
23125 * statement.cs: Finish implementation of foreach for single
23128 * cs-parser.jay: Use an out-of-band stack to pass information
23129 around, I wonder why I need this.
23131 foreach_block: Make the new foreach_block the current_block.
23133 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23134 function used to return a static Parameters structure. Used for
23135 empty parameters, as those are created very frequently.
23137 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23139 2001-11-15 Ravi Pratap <ravi@ximian.com>
23141 * interface.cs : Default modifier is private, not public. The
23142 make verify test passes again.
23144 2001-11-15 Ravi Pratap <ravi@ximian.com>
23146 * support.cs (ReflectionParameters): Fix logic to determine
23147 whether the last parameter is a params one. Test 9 passes again.
23149 * delegate.cs (Populate): Register the builders we define with
23150 RegisterParameterForBuilder. Test 19 passes again.
23152 * cs-parser.jay (property_declaration): Reference $6 instead
23153 of $$ to get at the location.
23155 (indexer_declaration): Similar stuff.
23157 (attribute): Ditto.
23159 * class.cs (Property): Register parameters for the Get and Set methods
23160 if they exist. Test 23 passes again.
23162 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23163 call to EmitArguments as we are sure there aren't any params arguments.
23164 Test 32 passes again.
23166 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23167 IndexOutOfRangeException.
23169 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23170 Test 33 now passes again.
23172 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23174 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23175 broke a bunch of things. Will have to come up with a better way
23176 of tracking locations.
23178 * statement.cs: Implemented foreach for single dimension arrays.
23180 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23182 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23183 an error. This removes the lookup from the critical path.
23185 * cs-parser.jay: Removed use of temporary_loc, which is completely
23188 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23190 * support.cs (ReflectionParameters.ParameterModifier): Report
23191 whether the argument is a PARAMS argument or not.
23193 * class.cs: Set the attribute `ParamArrayAttribute' on the
23194 parameter argument.
23196 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23197 and cons_param_array_attribute (ConstructorInfo for
23198 ParamArrayAttribute).,
23200 * codegen.cs: Emit the return using the `Return' statement, that
23201 way we can report the error correctly for missing return values.
23203 * class.cs (Method.Emit): Clean up.
23205 * expression.cs (Argument.Resolve): Take another argument: the
23206 location where this argument is used. Notice that this is not
23207 part of the "Argument" class as to reduce the size of the
23208 structure (we know the approximate location anyways).
23210 Test if the argument is a variable-reference, if not, then
23211 complain with a 206.
23213 (Argument.Emit): Emit addresses of variables.
23215 (Argument.FullDesc): Simplify.
23217 (Invocation.DoResolve): Update for Argument.Resolve.
23219 (ElementAccess.DoResolve): ditto.
23221 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23222 method should be virtual, as this method is always virtual.
23224 (NewDelegate.DoResolve): Update for Argument.Resolve.
23226 * class.cs (ConstructorInitializer.DoResolve): ditto.
23228 * attribute.cs (Attribute.Resolve): ditto.
23230 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23232 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23234 * expression.cs (ParameterReference): Drop IStackStorage and implement
23235 IAssignMethod instead.
23237 (LocalVariableReference): ditto.
23239 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23240 IAssignMethod instead.
23242 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23244 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23245 enumerations that are used in heavily used structures derive from
23246 byte in a laughable and pathetic attempt to reduce memory usage.
23247 This is the kind of pre-optimzations that you should not do at
23248 home without adult supervision.
23250 * expression.cs (UnaryMutator): New class, used to handle ++ and
23251 -- separatedly from the other unary operators. Cleans up the
23252 code, and kills the ExpressionStatement dependency in Unary.
23254 (Unary): Removed `method' and `Arguments' from this class, making
23255 it smaller, and moving it all to SimpleCall, so I can reuse this
23256 code in other locations and avoid creating a lot of transient data
23257 strucutres when not required.
23259 * cs-parser.jay: Adjust for new changes.
23261 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23263 * enum.cs (Enum.Populate): If there is a failure during
23266 * cs-parser.jay (opt_enum_base): we used to catch type errors
23267 here, but this is really incorrect. The type error should be
23268 catched during semantic analysis.
23270 2001-12-11 Ravi Pratap <ravi@ximian.com>
23272 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23273 current_local_parameters as expected since I, in my stupidity, had forgotten
23276 * attribute.cs (GetValidPlaces): Fix stupid bug.
23278 * class.cs (Method::Emit): Perform check on applicability of attributes.
23280 (Constructor::Emit): Ditto.
23282 (Field::Emit): Ditto.
23284 (Field.Location): Store location information.
23286 (Property, Event, Indexer, Operator): Ditto.
23288 * cs-parser.jay (field_declaration): Pass in location for each field.
23290 * ../errors/cs0592.cs : Add.
23292 2001-11-12 Ravi Pratap <ravi@ximian.com>
23294 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23296 (InitCoreTypes): Update accordingly.
23298 (RegisterAttrType, LookupAttr): Implement.
23300 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23301 info about the same.
23303 (Resolve): Update to populate the above as necessary.
23305 (Error592): Helper.
23307 (GetValidPlaces): Helper to the above.
23309 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23311 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23313 2001-11-12 Ravi Pratap <ravi@ximian.com>
23315 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23317 * ../errors/cs0617.cs : Add.
23319 2001-11-11 Ravi Pratap <ravi@ximian.com>
23321 * enum.cs (Emit): Rename to Populate to be more consistent with what
23322 we expect it to do and when exactly it is called.
23324 * class.cs, rootcontext.cs : Update accordingly.
23326 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23327 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23329 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23331 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23332 of a fieldinfo using the above, when dealing with a FieldBuilder.
23334 2001-11-10 Ravi Pratap <ravi@ximian.com>
23336 * ../errors/cs0031.cs : Add.
23338 * ../errors/cs1008.cs : Add.
23340 * ../errrors/cs0543.cs : Add.
23342 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23345 (FindMembers): Implement.
23347 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23348 enums and delegates too.
23350 (enum_types): Rename to builder_to_enum.
23352 (delegate_types): Rename to builder_to_delegate.
23354 * delegate.cs (FindMembers): Implement.
23356 2001-11-09 Ravi Pratap <ravi@ximian.com>
23358 * typemanager.cs (IsEnumType): Implement.
23360 * enum.cs (Emit): Re-write parts to account for the underlying type
23361 better and perform checking etc.
23363 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23364 of the underlying type.
23366 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23369 * enum.cs (error31): Helper to report error #31.
23371 * cs-parser.jay (enum_declaration): Store location of each member too.
23373 * enum.cs (member_to_location): New hashtable.
23375 (AddEnumMember): Update location hashtable.
23377 (Emit): Use the location of each member while reporting errors.
23379 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23381 * cs-parser.jay: A for_initializer if is a
23382 local_variable_declaration really ammount to have an implicit
23383 block with the variable declaration and no initializer for for.
23385 * statement.cs (For.Emit): Cope with null initializers.
23387 This fixes the infinite loop on for initializers.
23389 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23391 * enum.cs: More cleanup.
23393 * ecore.cs: Remove dead code.
23395 * class.cs (Property.Emit): More simplification.
23396 (Event.Emit): ditto.
23398 Reworked to have less levels of indentation.
23400 2001-11-08 Ravi Pratap <ravi@ximian.com>
23402 * class.cs (Property): Emit attributes.
23412 * enum.cs (Emit): Ditto.
23414 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23417 * class.cs (Field, Event, etc.): Move attribute generation into the
23418 Emit method everywhere.
23420 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23421 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23422 as we had no way of defining nested enums !
23424 * rootcontext.cs : Adjust code accordingly.
23426 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23428 2001-11-07 Ravi Pratap <ravi@ximian.com>
23430 * expression.cs (EvalConstantExpression): Move into ecore.cs
23432 * enum.cs (Enum): Rename some members and make them public and readonly
23433 according to our convention.
23435 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23438 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23440 (Enum::Emit): Write a simple version for now which doesn't try to compute
23441 expressions. I shall modify this to be more robust in just a while.
23443 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23445 (TypeContainer::CloseType): Create the Enum types too.
23447 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23449 * expression.cs (EvalConstantExpression): Get rid of completely.
23451 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23452 user-defined values and other cases.
23454 (IsValidEnumLiteral): Helper function.
23456 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23457 out there in the case we had a literal FieldExpr.
23459 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23461 (Literalize): Revamp a bit to take two arguments.
23463 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23465 2001-11-06 Ravi Pratap <ravi@ximian.com>
23467 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23469 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23471 (Resolve): Use the above to ensure we have proper initializers.
23473 2001-11-05 Ravi Pratap <ravi@ximian.com>
23475 * expression.cs (Expression::EvalConstantExpression): New method to
23476 evaluate constant expressions.
23478 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23480 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23482 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23485 (Binary.ResolveOperator): Handle operator != (object a, object b)
23486 and operator == (object a, object b);
23488 (Binary.DoNumericPromotions): Indicate whether the numeric
23489 promotion was possible.
23491 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23494 Made the ArrayAccess implement interface IAssignMethod instead of
23495 IStackStore as the order in which arguments are passed reflects
23498 * assign.cs: Instead of using expr.ExprClass to select the way of
23499 assinging, probe for the IStackStore/IAssignMethod interfaces.
23501 * typemanager.cs: Load InitializeArray definition.
23503 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23504 static data that can be used to initialize arrays.
23506 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23508 * expression.cs: Handle operator== and operator!= for booleans.
23510 (Conditioal.Reduce): Implement reducer for the ?: operator.
23512 (Conditional.Resolve): Implement dead code elimination.
23514 (Binary.Resolve): Catch string literals and return a new
23515 concatenated string.
23517 (Unary.Reduce): Implement reduction of unary expressions.
23519 * ecore.cs: Split out the expression core handling here.
23521 (Expression.Reduce): New method used to perform constant folding
23522 and CSE. This is needed to support constant-expressions.
23524 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23525 targets, and optimize for !x.
23527 2001-11-04 Ravi Pratap <ravi@ximian.com>
23529 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23530 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23531 set custom atttributes.
23533 * literal.cs (Literal::GetValue): New abstract method to return the actual
23534 value of the literal, cast as an object.
23536 (*Literal): Implement GetValue method.
23538 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23539 expressions to the arraylist but objects of type Argument.
23541 * class.cs (TypeContainer::Emit): Emit our attributes too.
23543 (Method::Emit, Constructor::Emit): Ditto.
23545 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23546 to be ignoring earlier.
23548 2001-11-03 Ravi Pratap <ravi@ximian.com>
23550 * attribute.cs (AttributeSection::Define): Implement to do the business
23551 of constructing a CustomAttributeBuilder.
23553 (Attribute): New trivial class. Increases readability of code.
23555 * cs-parser.jay : Update accordingly.
23557 (positional_argument_list, named_argument_list, named_argument): New rules
23559 (attribute_arguments): Use the above so that we are more correct.
23561 2001-11-02 Ravi Pratap <ravi@ximian.com>
23563 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23564 to perform all checks for a method with a params parameter.
23566 (Invocation::OverloadResolve): Update to use the above method and therefore
23567 cope correctly with params method invocations.
23569 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23572 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23573 constructors in our parent too because we can't afford to miss out on
23576 * attribute.cs (AttributeSection): New name for the class Attribute
23578 Other trivial changes to improve readability.
23580 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23581 use the new class names.
23583 2001-11-01 Ravi Pratap <ravi@ximian.com>
23585 * class.cs (Method::Define): Complete definition for params types too
23587 (Indexer::Define): Ditto.
23589 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23590 Cope everywhere with a request for info about the array parameter.
23592 2001-11-01 Ravi Pratap <ravi@ximian.com>
23594 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23596 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23597 local_variable_type to extract the string corresponding to the type.
23599 (local_variable_type): Fixup the action to use the new helper method.
23601 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23604 * expression.cs : Clean out code which uses the above.
23606 2001-10-31 Ravi Pratap <ravi@ximian.com>
23608 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23609 and bale out if necessary by returning a false.
23611 (RegisterProperty): Ditto.
23613 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23614 and print out appropriate error messages.
23616 * interface.cs (everywhere): Ditto.
23618 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23619 location to constructor.
23621 * class.cs (Property, Event, Indexer): Update accordingly.
23623 * ../errors/cs111.cs : Added.
23625 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23626 of a method, as laid down by the spec.
23628 (Invocation::OverloadResolve): Use the above method.
23630 2001-10-31 Ravi Pratap <ravi@ximian.com>
23632 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23633 now take a TypeContainer and a Parameters object.
23635 (ParameterData): Modify return type of ParameterModifier method to be
23636 Parameter.Modifier and not a string.
23638 (ReflectionParameters, InternalParameters): Update accordingly.
23640 * expression.cs (Argument::GetParameterModifier): Same here.
23642 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23643 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23644 symbol in it at all so maybe this is only for now.
23646 2001-10-30 Ravi Pratap <ravi@ximian.com>
23648 * support.cs (InternalParameters): Constructor now takes an extra argument
23649 which is the actual Parameters class.
23651 (ParameterDesc): Update to provide info on ref/out modifiers.
23653 * class.cs (everywhere): Update call to InternalParameters to pass in
23654 the second argument too.
23656 * support.cs (ParameterData): Add ParameterModifier, which is a method
23657 to return the modifier info [ref/out etc]
23659 (InternalParameters, ReflectionParameters): Implement the above.
23661 * expression.cs (Argument::ParameterModifier): Similar function to return
23662 info about the argument's modifiers.
23664 (Invocation::OverloadResolve): Update to take into account matching modifiers
23667 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23668 a new SetFormalParameters object which we pass to InternalParameters.
23670 2001-10-30 Ravi Pratap <ravi@ximian.com>
23672 * expression.cs (NewArray): Merge into the ArrayCreation class.
23674 2001-10-29 Ravi Pratap <ravi@ximian.com>
23676 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23677 NewUserdefinedArray into one as there wasn't much of a use in having
23680 * expression.cs (Argument): Change field's name to ArgType from Type.
23682 (Type): New readonly property which returns the proper type, taking into
23683 account ref/out modifiers.
23685 (everywhere): Adjust code accordingly for the above.
23687 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23688 whether we are emitting for a ref or out parameter.
23690 * expression.cs (Argument::Emit): Use the above field to set the state.
23692 (LocalVariableReference::Emit): Update to honour the flag and emit the
23695 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23697 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23699 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23701 (ReflectionParameters, InternalParameters): Implement the above method.
23703 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23706 (Invocation::FullMethodDesc): Ditto.
23708 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23710 * cs-parser.jay: Add extra production for the second form of array
23713 * expression.cs (ArrayCreation): Update to reflect the above
23716 * Small changes to prepare for Array initialization.
23718 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23720 * typemanager.cs (ImplementsInterface): interface might be null;
23721 Deal with this problem;
23723 Also, we do store negative hits on the cache (null values), so use
23724 this instead of calling t.GetInterfaces on the type everytime.
23726 2001-10-28 Ravi Pratap <ravi@ximian.com>
23728 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23730 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23731 split functionality out into different classes.
23733 (New::FormArrayType): Move into NewBuiltinArray.
23735 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23738 (NewBuiltinArray): New class to handle creation of built-in arrays.
23740 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23741 account creation of one-dimensional arrays.
23743 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23745 (NewUserdefinedArray::DoResolve): Implement.
23747 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23749 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23750 we maintain inside the TypeManager. This is necessary to perform lookups on the
23753 (LookupType): Update to perform GetType on the module builders too.
23755 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23757 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23759 2001-10-23 Ravi Pratap <ravi@ximian.com>
23761 * expression.cs (New::DoResolve): Implement guts of array creation.
23763 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23765 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23767 * expression.cs: Fix bug I introduced lsat night that broke
23770 (Expression.Resolve): Report a 246 error (can not resolve name)
23771 if we find a SimpleName in the stream.
23773 (Expression.ResolveLValue): Ditto.
23775 (Expression.ResolveWithSimpleName): This function is a variant of
23776 ResolveName, this one allows SimpleNames to be returned without a
23777 warning. The only consumer of SimpleNames is MemberAccess
23779 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23781 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23782 might arrive here. I have my doubts that this is correct.
23784 * statement.cs (Lock): Implement lock statement.
23786 * cs-parser.jay: Small fixes to support `lock' and `using'
23788 * cs-tokenizer.cs: Remove extra space
23790 * driver.cs: New flag --checked, allows to turn on integer math
23793 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23794 Threading.Monitor.Exit
23796 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23798 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23799 Expression Class to be IndexerAccess.
23801 Notice that Indexer::DoResolve sets the eclass to Value.
23803 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23805 * class.cs (TypeContainer::Emit): Emit code for indexers.
23807 * assign.cs (IAssignMethod): New interface implemented by Indexers
23808 and Properties for handling assignment.
23810 (Assign::Emit): Simplify and reuse code.
23812 * expression.cs (IndexerAccess, PropertyExpr): Implement
23813 IAssignMethod, clean up old code.
23815 2001-10-22 Ravi Pratap <ravi@ximian.com>
23817 * typemanager.cs (ImplementsInterface): New method to determine if a type
23818 implements a given interface. Provides a nice cache too.
23820 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23823 (ConvertReferenceExplicit): Ditto.
23825 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23826 various methods, with correct names etc.
23828 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23829 Operator.UnaryNegation.
23831 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23832 we have a unary plus or minus operator.
23834 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23837 * everywhere : update accordingly.
23839 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23842 * class.cs (Method::Define): For the case where we are implementing a method
23843 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23844 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23846 2001-10-21 Ravi Pratap <ravi@ximian.com>
23848 * interface.cs (FindMembers): Implement to work around S.R.E
23851 * typemanager.cs (IsInterfaceType): Implement.
23853 (FindMembers): Update to handle interface types too.
23855 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23856 use IsAssignableFrom as that is not correct - it doesn't work.
23858 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23859 and accordingly override EmitStatement.
23861 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23862 using the correct logic :-)
23864 2001-10-19 Ravi Pratap <ravi@ximian.com>
23866 * ../errors/cs-11.cs : Add to demonstrate error -11
23868 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23870 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23871 then pass this as a hint to ResolveLValue.
23873 * expression.cs (FieldExpr): Add Location information
23875 (FieldExpr::LValueResolve): Report assignment to readonly
23878 (Expression::ExprClassFromMemberInfo): Pass location information.
23880 (Expression::ResolveLValue): Add new method that resolves an
23883 (Expression::DoResolveLValue): Default invocation calls
23886 (Indexers): New class used to keep track of indexers in a given
23889 (IStackStore): Renamed from LValue, as it did not really describe
23890 what this did. Also ResolveLValue is gone from this interface and
23891 now is part of Expression.
23893 (ElementAccess): Depending on the element access type
23895 * typemanager.cs: Add `indexer_name_type' as a Core type
23896 (System.Runtime.CompilerServices.IndexerNameAttribute)
23898 * statement.cs (Goto): Take a location.
23900 2001-10-18 Ravi Pratap <ravi@ximian.com>
23902 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23903 if two delegates are compatible.
23905 (NewDelegate::DoResolve): Update to take care of the case when
23906 we instantiate a delegate from another delegate.
23908 * typemanager.cs (FindMembers): Don't even try to look up members
23909 of Delegate types for now.
23911 2001-10-18 Ravi Pratap <ravi@ximian.com>
23913 * delegate.cs (NewDelegate): New class to take care of delegate
23916 * expression.cs (New): Split the delegate related code out into
23917 the NewDelegate class.
23919 * delegate.cs (DelegateInvocation): New class to handle delegate
23922 * expression.cs (Invocation): Split out delegate related code into
23923 the DelegateInvocation class.
23925 2001-10-17 Ravi Pratap <ravi@ximian.com>
23927 * expression.cs (New::DoResolve): Implement delegate creation fully
23928 and according to the spec.
23930 (New::DoEmit): Update to handle delegates differently.
23932 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23933 because of which we were printing out arguments in reverse order !
23935 * delegate.cs (VerifyMethod): Implement to check if the given method
23936 matches the delegate.
23938 (FullDelegateDesc): Implement.
23940 (VerifyApplicability): Implement.
23942 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23943 delegate invocations too.
23945 (Invocation::Emit): Ditto.
23947 * ../errors/cs1593.cs : Added.
23949 * ../errors/cs1594.cs : Added.
23951 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23953 2001-10-16 Ravi Pratap <ravi@ximian.com>
23955 * typemanager.cs (intptr_type): Core type for System.IntPtr
23957 (InitCoreTypes): Update for the same.
23959 (iasyncresult_type, asynccallback_type): Ditto.
23961 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23964 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23967 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23968 the builders for the 4 members of a delegate type :-)
23970 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23973 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23975 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23977 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23979 * statement.cs (Break::Emit): Implement.
23980 (Continue::Emit): Implement.
23982 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23983 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23984 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23985 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23988 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23989 properties that track the label for the current loop (begin of the
23990 loop and end of the loop).
23992 2001-10-15 Ravi Pratap <ravi@ximian.com>
23994 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23995 use of emitting anything at all.
23997 * class.cs, rootcontext.cs : Get rid of calls to the same.
23999 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24001 (Populate): Define the constructor correctly and set the implementation
24004 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24007 (AddDelegateType): Implement.
24009 (IsDelegateType): Implement helper method.
24011 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24013 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24014 and accordingly handle it.
24016 * delegate.cs (Populate): Take TypeContainer argument.
24017 Implement bits to define the Invoke method. However, I still haven't figured out
24018 how to take care of the native int bit :-(
24020 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24021 Qualify the name of the delegate, not its return type !
24023 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24026 (StandardConversionExists): Checking for array types turns out to be recursive.
24028 (ConvertReferenceExplicit): Implement array conversion.
24030 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24032 2001-10-12 Ravi Pratap <ravi@ximian.com>
24034 * cs-parser.jay (delegate_declaration): Store the fully qualified
24035 name as it is a type declaration.
24037 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24040 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24041 as TypeContainer::DefineType.
24043 (Populate): Method in which all the definition of the various methods (Invoke)
24046 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24049 (CloseDelegate): Finally creates the delegate.
24051 * class.cs (TypeContainer::DefineType): Update to define delegates.
24052 (Populate, Emit and CloseType): Do the same thing here too.
24054 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24055 delegates in all these operations.
24057 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24059 * expression.cs: LocalTemporary: a new expression used to
24060 reference a temporary that has been created.
24062 * assign.cs: Handle PropertyAccess back here, so that we can
24063 provide the proper semantic access to properties.
24065 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24066 a few more explicit conversions.
24068 * modifiers.cs: `NEW' modifier maps to HideBySig.
24070 * expression.cs (PropertyExpr): Make this into an
24071 ExpressionStatement, and support the EmitStatement code path.
24073 Perform get/set error checking, clean up the interface.
24075 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24076 them into toplevel access objects.
24078 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24080 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24083 * typemanager.cs: Keep track here of our PropertyBuilders again to
24084 work around lameness in SRE.
24086 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24088 * expression.cs (LValue::LValueResolve): New method in the
24089 interface, used to perform a second resolution pass for LValues.
24091 (This::DoResolve): Catch the use of this in static methods.
24093 (This::LValueResolve): Implement.
24095 (This::Store): Remove warning, assigning to `this' in structures
24098 (Invocation::Emit): Deal with invocation of
24099 methods on value types. We need to pass the address to structure
24100 methods rather than the object itself. (The equivalent code to
24101 emit "this" for structures leaves the entire structure on the
24102 stack instead of a pointer to it).
24104 (ParameterReference::DoResolve): Compute the real index for the
24105 argument based on whether the method takes or not a `this' pointer
24106 (ie, the method is static).
24108 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24109 value types returned from functions when we need to invoke a
24110 method on the sturcture.
24113 2001-10-11 Ravi Pratap <ravi@ximian.com>
24115 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24116 defining the type in the Modulebuilder or Typebuilder. This is to take
24117 care of nested types which need to be defined on the TypeBuilder using
24118 DefineNestedMethod.
24120 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24121 methods in RootContext, only ported to be part of TypeContainer.
24123 (TypeContainer::GetInterfaceOrClass): Ditto.
24125 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24127 * interface.cs (Interface::DefineInterface): New method. Does exactly
24128 what RootContext.CreateInterface did earlier, only it takes care of nested types
24131 (Interface::GetInterfaces): Move from RootContext here and port.
24133 (Interface::GetInterfaceByName): Same here.
24135 * rootcontext.cs (ResolveTree): Re-write.
24137 (PopulateTypes): Re-write.
24139 * class.cs (TypeContainer::Populate): Populate nested types too.
24140 (TypeContainer::Emit): Emit nested members too.
24142 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24143 instead just use the name argument passed in as it is already fully
24146 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24147 to TypeContainer mapping to see if a type is user-defined.
24149 * class.cs (TypeContainer::CloseType): Implement.
24151 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24152 the default constructor.
24154 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24157 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24159 * interface.cs (CloseType): Create the type here.
24161 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24164 Remove all the methods which are now in TypeContainer.
24166 2001-10-10 Ravi Pratap <ravi@ximian.com>
24168 * delegate.cs (Define): Re-write bits to define the delegate
24171 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24173 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24175 * expression.cs (ImplicitReferenceConversion): handle null as well
24176 as a source to convert to any reference type.
24178 * statement.cs (Return): Perform any implicit conversions to
24179 expected return type.
24181 Validate use of return statement.
24183 * codegen.cs (EmitContext): Pass the expected return type here.
24185 * class.cs (Method, Constructor, Property): Pass expected return
24186 type to EmitContext.
24188 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24190 * expression.cs: Make DoResolve take an EmitContext instead of a
24193 Replaced `l' and `location' for `loc', for consistency.
24195 (Error, Warning): Remove unneeded Tc argument.
24197 * assign.cs, literal.cs, constant.cs: Update to new calling
24200 * codegen.cs: EmitContext now contains a flag indicating whether
24201 code is being generated in a static method or not.
24203 * cs-parser.jay: DecomposeQI, new function that replaces the old
24204 QualifiedIdentifier. Now we always decompose the assembled
24205 strings from qualified_identifier productions into a group of
24208 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24210 * rootcontext.cs: Deal with field-less struct types correctly now
24211 by passing the size option to Define Type.
24213 * class.cs: Removed hack that created one static field.
24215 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24217 * statement.cs: Moved most of the code generation here.
24219 2001-10-09 Ravi Pratap <ravi@ximian.com>
24221 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24224 (ElementAccess): Remove useless bits for now - keep checks as the spec
24227 2001-10-08 Ravi Pratap <ravi@ximian.com>
24229 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24230 and start performing checks according to the spec.
24232 2001-10-07 Ravi Pratap <ravi@ximian.com>
24234 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24235 rank_specifiers instead.
24237 (rank_specifiers): Change the order in which the rank specifiers are stored
24239 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24241 * expression.cs (ElementAccess): Implement the LValue interface too.
24243 2001-10-06 Ravi Pratap <ravi@ximian.com>
24245 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24246 except that user defined conversions are not included.
24248 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24249 perform the conversion of the return type, if necessary.
24251 (New::DoResolve): Check whether we are creating an array or an object
24252 and accordingly do the needful.
24254 (New::Emit): Same here.
24256 (New::DoResolve): Implement guts of array creation.
24258 (New::FormLookupType): Helper function.
24260 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24262 * codegen.cs: Removed most of the code generation here, and move the
24263 corresponding code generation bits to the statement classes.
24265 Added support for try/catch/finalize and throw.
24267 * cs-parser.jay: Added support for try/catch/finalize.
24269 * class.cs: Catch static methods having the flags override,
24270 virtual or abstract.
24272 * expression.cs (UserCast): This user cast was not really doing
24273 what it was supposed to do. Which is to be born in fully resolved
24274 state. Parts of the resolution were being performed at Emit time!
24278 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24280 * expression.cs: Implicity convert the result from UserCast.
24282 2001-10-05 Ravi Pratap <ravi@ximian.com>
24284 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24285 prevented it from working correctly.
24287 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24288 merely ConvertImplicit.
24290 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24292 * typemanager.cs: Make the LookupTypeContainer function static,
24293 and not per-instance.
24295 * class.cs: Make static FindMembers (the one that takes a Type
24298 * codegen.cs: Add EmitForeach here.
24300 * cs-parser.jay: Make foreach a toplevel object instead of the
24301 inline expansion, as we need to perform semantic analysis on it.
24303 2001-10-05 Ravi Pratap <ravi@ximian.com>
24305 * expression.cs (Expression::ImplicitUserConversion): Rename to
24306 UserDefinedConversion.
24308 (Expression::UserDefinedConversion): Take an extra argument specifying
24309 whether we look for explicit user conversions too.
24311 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24313 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24315 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24316 with the appropriate arguments.
24318 * cs-parser.jay (cast_expression): Record location too.
24320 * expression.cs (Cast): Record location info.
24322 (Expression::ConvertExplicit): Take location argument.
24324 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24325 to determine if we are doing explicit conversions.
24327 (UserCast::Emit): Update accordingly.
24329 (Expression::ConvertExplicit): Report an error if everything fails.
24331 * ../errors/cs0030.cs : Add.
24333 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24335 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24336 virtual and newslot bits.
24338 * class.cs (TypeContainer::RegisterRequiredImplementations):
24339 Record methods we need.
24341 (TypeContainer::MakeKey): Helper function to make keys for
24342 MethodBases, since the Methodbase key is useless.
24344 (TypeContainer::Populate): Call RegisterRequiredImplementations
24345 before defining the methods.
24347 Create a mapping for method_builders_to_methods ahead of time
24348 instead of inside a tight loop.
24350 (::RequireMethods): Accept an object as the data to set into the
24351 hashtable so we can report interface vs abstract method mismatch.
24353 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24355 * report.cs: Make all of it static.
24357 * rootcontext.cs: Drop object_type and value_type computations, as
24358 we have those in the TypeManager anyways.
24360 Drop report instance variable too, now it is a global.
24362 * driver.cs: Use try/catch on command line handling.
24364 Add --probe option to debug the error reporting system with a test
24367 * report.cs: Add support for exiting program when a probe
24368 condition is reached.
24370 2001-10-03 Ravi Pratap <ravi@ximian.com>
24372 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24373 we do a forcible conversion regardless of type, to check if
24374 ForceConversion returns a null.
24376 (Binary::error19): Use location to report error.
24378 (Unary::error23): Use location here too.
24380 * ../errors/cs0019.cs : Check in.
24382 * ../errors/cs0023.cs : Check in.
24384 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24385 case of a non-null MethodInfo object with a length of 0 !
24387 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24388 an applicable member - according to the spec :-)
24389 Also fix logic to find members in base types.
24391 (Unary::ResolveOperator): Same here.
24393 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24394 as I was getting thoroughly confused between this and error19 :-)
24396 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24397 (::FindMostEncompassedType): Implement.
24398 (::FindMostEncompassingType): Implement.
24399 (::StandardConversionExists): Implement.
24401 (UserImplicitCast): Re-vamp. We now need info about most specific
24402 source and target types so that we can do the necessary conversions.
24404 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24405 mathematical union with no duplicates.
24407 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24409 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24410 in order from base classes to child classes, so that we can in
24411 child classes look up in our parent for method names and
24412 attributes (required for handling abstract, virtual, new, override
24413 constructs: we need to instrospect our base class, and if we dont
24414 populate the classes in order, the introspection might be
24415 incorrect. For example, a method could query its parent before
24416 the parent has any methods and would determine that the parent has
24417 no abstract methods (while it could have had them)).
24419 (RootContext::CreateType): Record the order in which we define the
24422 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24424 * class.cs (TypeContainer::Populate): Also method definitions can
24425 fail now, keep track of this.
24427 (TypeContainer::FindMembers): Implement support for
24428 DeclaredOnly/noDeclaredOnly flag.
24430 (Constructor::Emit) Return the ConstructorBuilder.
24432 (Method::Emit) Return the MethodBuilder.
24433 Check for abstract or virtual methods to be public.
24435 * rootcontext.cs (RootContext::CreateType): Register all the
24436 abstract methods required for the class to be complete and the
24437 interface methods that must be implemented.
24439 * cs-parser.jay: Report error 501 (method requires body if it is
24440 not marked abstract or extern).
24442 * expression.cs (TypeOf::Emit): Implement.
24444 * typemanager.cs: runtime_handle_type, new global type.
24446 * class.cs (Property::Emit): Generate code for properties.
24448 2001-10-02 Ravi Pratap <ravi@ximian.com>
24450 * expression.cs (Unary::ResolveOperator): Find operators on base type
24451 too - we now conform exactly to the spec.
24453 (Binary::ResolveOperator): Same here.
24455 * class.cs (Operator::Define): Fix minor quirk in the tests.
24457 * ../errors/cs0215.cs : Added.
24459 * ../errors/cs0556.cs : Added.
24461 * ../errors/cs0555.cs : Added.
24463 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24465 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24466 single integer which is really efficient
24468 2001-10-01 Ravi Pratap <ravi@ximian.com>
24470 * expression.cs (Expression::ImplicitUserConversion): Use location
24471 even in the case when we are examining True operators.
24473 * class.cs (Operator::Define): Perform extensive checks to conform
24474 with the rules for operator overloading in the spec.
24476 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24477 some of the other conversions mentioned in the spec.
24479 * typemanager.cs (array_type): New static member for the System.Array built-in
24482 (cloneable_interface): For System.ICloneable interface.
24484 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24485 we start resolving the tree and populating types.
24487 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24489 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24491 * expression.cs (Expression::ExprClassFromMemberInfo,
24492 Expression::Literalize): Create literal expressions from
24493 FieldInfos which are literals.
24495 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24496 type casts, because they were wrong. The test suite in tests
24499 (ImplicitNumericConversion): ushort to ulong requires a widening
24502 Int32 constant to long requires widening cast as well.
24504 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24505 for integers because the type on the stack is not i4.
24507 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24509 * expression.cs (report118): require location argument.
24511 * parameter.cs: Do not dereference potential null value.
24513 * class.cs: Catch methods that lack the `new' keyword when
24514 overriding a name. Report warnings when `new' is used without
24515 anything being there to override.
24517 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24519 * class.cs: Only add constructor to hashtable if it is non-null
24520 (as now constructors can fail on define).
24522 (TypeManager, Class, Struct): Take location arguments.
24524 Catch field instance initialization in structs as errors.
24526 accepting_filter: a new filter for FindMembers that is static so
24527 that we dont create an instance per invocation.
24529 (Constructor::Define): Catch errors where a struct constructor is
24532 * cs-parser.jay: Pass location information for various new
24535 * delegate.cs (Delegate): take a location argument.
24537 * driver.cs: Do not call EmitCode if there were problesm in the
24538 Definition of the types, as many Builders wont be there.
24540 * decl.cs (Decl::Decl): Require a location argument.
24542 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24543 into integers, and find the most appropiate integer for it.
24545 * literal.cs: Implement ULongLiteral.
24547 * rootcontext.cs: Provide better information about the location of
24548 failure when CreateType fails.
24550 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24552 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24555 * expression.cs (Binary::CheckShiftArguments): Add missing type
24557 (Binary::ResolveOperator): Add type to the logical and and logical
24558 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24561 (Binary::DoNumericPromotions): In the case where either argument
24562 is ulong (and most signed types combined with ulong cause an
24563 error) perform implicit integer constant conversions as well.
24565 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24567 * expression.cs (UserImplicitCast): Method should always be
24569 (Invocation::BetterConversion): Simplified test for IntLiteral.
24571 (Expression::ImplicitNumericConversion): Split this routine out.
24572 Put the code that performs implicit constant integer conversions
24575 (Expression::Resolve): Become a wrapper around DoResolve so we can
24576 check eclass and type being set after resolve.
24578 (Invocation::Badness): Remove this dead function
24580 (Binary::ResolveOperator): Do not compute the expensive argumnets
24581 unless we have a union for it.
24583 (Probe::Emit): Is needs to do an isinst and then
24584 compare against null.
24586 (::CanConvert): Added Location argument. If the Location argument
24587 is null (Location.Null), then we do not report errors. This is
24588 used by the `probe' mechanism of the Explicit conversion. We do
24589 not want to generate an error for something that the user
24590 explicitly requested to be casted. But the pipeline for an
24591 explicit cast first tests for potential implicit casts.
24593 So for now, if the Location is null, it means `Probe only' to
24594 avoid adding another argument. Might have to revise this
24597 (ClassCast): New class used to type cast objects into arbitrary
24598 classes (used in Explicit Reference Conversions).
24600 Implement `as' as well.
24602 Reverted all the patches from Ravi below: they were broken:
24604 * The use of `level' as a mechanism to stop recursive
24605 invocations is wrong. That was there just to catch the
24606 bug with a strack trace but not as a way of addressing
24609 To fix the problem we have to *understand* what is going
24610 on and the interactions and come up with a plan, not
24611 just get things going.
24613 * The use of the type conversion cache that I proposed
24614 last night had an open topic: How does this work across
24615 protection domains. A user defined conversion might not
24616 be public in the location where we are applying the
24617 conversion, a different conversion might be selected
24618 (ie, private A->B (better) but public B->A (worse),
24619 inside A, A->B applies, but outside it, B->A will
24622 * On top of that (ie, even if the above is solved),
24623 conversions in a cache need to be abstract. Ie, `To
24624 convert from an Int to a Short use an OpcodeCast', not
24625 `To convert from an Int to a Short use the OpcodeCast on
24626 the variable 5' (which is what this patch was doing).
24628 2001-09-28 Ravi Pratap <ravi@ximian.com>
24630 * expression.cs (Invocation::ConversionExists): Re-write to use
24631 the conversion cache
24633 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24634 cache all conversions done, not just user-defined ones.
24636 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24637 to determine if a conversion exists instead of acutually trying to
24638 perform the conversion. It's faster too.
24640 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24641 and only then attempt the implicit conversion.
24643 2001-09-28 Ravi Pratap <ravi@ximian.com>
24645 * expression.cs (ConvertImplicit): Use a cache for conversions
24646 already found. Check level of recursion and bail out if necessary.
24648 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24650 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24651 Export standard methods that we expect for string operations.
24653 * statement.cs (Block::UsageWarning): Track usage of variables and
24654 report the errors for not used variables.
24656 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24659 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24661 * codegen.cs: remove unnneded code
24663 * expression.cs: Removed BuiltinTypeAccess class
24665 Fix the order in which implicit conversions are
24668 The previous fixed dropped support for boxed conversions (adding a
24669 test to the test suite now)
24671 (UserImplicitCast::CanConvert): Remove test for source being null,
24672 that code is broken. We should not feed a null to begin with, if
24673 we do, then we should track the bug where the problem originates
24674 and not try to cover it up here.
24676 Return a resolved expression of type UserImplicitCast on success
24677 rather than true/false. Ravi: this is what I was talking about,
24678 the pattern is to use a static method as a "constructor" for
24681 Also, do not create arguments until the very last minute,
24682 otherwise we always create the arguments even for lookups that
24683 will never be performed.
24685 (UserImplicitCast::Resolve): Eliminate, objects of type
24686 UserImplicitCast are born in a fully resolved state.
24688 * typemanager.cs (InitCoreTypes): Init also value_type
24689 (System.ValueType).
24691 * expression.cs (Cast::Resolve): First resolve the child expression.
24693 (LValue): Add new method AddressOf to be used by
24696 Change the argument of Store to take an EmitContext instead of an
24697 ILGenerator, because things like FieldExpr need to be able to call
24698 their children expression to generate the instance code.
24700 (Expression::Error, Expression::Warning): Sugar functions for
24703 (Expression::MemberLookup): Accept a TypeContainer instead of a
24704 Report as the first argument.
24706 (Expression::ResolvePrimary): Killed. I still want to improve
24707 this as currently the code is just not right.
24709 (Expression::ResolveMemberAccess): Simplify, but it is still
24712 (Unary::Resolve): Catch errors in AddressOf operators.
24714 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24715 index to a byte for the short-version, or the compiler will choose
24716 the wrong Emit call, which generates the wrong data.
24718 (ParameterReference::Emit, ::Store): same.
24720 (FieldExpr::AddressOf): Implement.
24722 * typemanager.cs: TypeManager: made public variable instead of
24725 * driver.cs: document --fatal.
24727 * report.cs (ErrorMessage, WarningMessage): new names for the old
24728 Error and Warning classes.
24730 * cs-parser.jay (member_access): Turn built-in access to types
24731 into a normal simplename
24733 2001-09-27 Ravi Pratap <ravi@ximian.com>
24735 * expression.cs (Invocation::BetterConversion): Fix to cope
24736 with q being null, since this was introducing a bug.
24738 * expression.cs (ConvertImplicit): Do built-in conversions first.
24740 2001-09-27 Ravi Pratap <ravi@ximian.com>
24742 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24744 2001-09-27 Ravi Pratap <ravi@ximian.com>
24746 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24747 I had introduced long ago (what's new ?).
24749 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24750 the work of all the checking.
24751 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24752 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24754 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24755 that is the right way.
24757 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24758 overloading resolution. Use everywhere instead of cutting and pasting code.
24760 (Binary::ResolveOperator): Use MakeUnionSet.
24762 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24763 we have to convert to bool types. Not complete yet.
24765 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24767 * typemanager.cs (TypeManager::CSharpName): support ushort.
24769 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24770 to provide an expression that performsn an implicit constant int
24771 conversion (section 6.1.6).
24772 (Expression::ConvertImplicitRequired): Reworked to include
24773 implicit constant expression conversions.
24775 (Expression::ConvertNumericExplicit): Finished.
24777 (Invocation::Emit): If InstanceExpression is null, then it means
24778 that we perform a call on this.
24780 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24782 * expression.cs (Unary::Emit): Remove some dead code.
24783 (Probe): Implement Resolve and Emit for `is'.
24784 (Expression::ConvertImplicitRequired): Attempt to do constant
24785 expression conversions here. Maybe should be moved to
24786 ConvertImplicit, but I am not sure.
24787 (Expression::ImplicitLongConstantConversionPossible,
24788 Expression::ImplicitIntConstantConversionPossible): New functions
24789 that tell whether is it possible to apply an implicit constant
24790 expression conversion.
24792 (ConvertNumericExplicit): Started work on explicit numeric
24795 * cs-parser.jay: Update operator constants.
24797 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24798 (Parameters::GetSignature): Hook up VerifyArgs here.
24799 (Parameters::VerifyArgs): Verifies that no two arguments have the
24802 * class.cs (Operator): Update the operator names to reflect the
24803 ones that the spec expects (as we are just stringizing the
24806 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24807 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24808 previous usage did only work for our methods.
24809 (Expression::ConvertImplicit): Handle decimal implicit numeric
24810 conversions as well.
24811 (Expression::InternalTypeConstructor): Used to invoke constructors
24812 on internal types for default promotions.
24814 (Unary::Emit): Implement special handling for the pre/post
24815 increment/decrement for overloaded operators, as they need to have
24816 the same semantics as the other operators.
24818 (Binary::ResolveOperator): ditto.
24819 (Invocation::ConversionExists): ditto.
24820 (UserImplicitCast::Resolve): ditto.
24822 2001-09-26 Ravi Pratap <ravi@ximian.com>
24824 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24825 operator, return after emitting body. Regression tests pass again !
24827 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24828 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24829 (Invocation::OverloadResolve): Ditto.
24830 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24832 * everywhere : update calls to the above methods accordingly.
24834 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24836 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24838 * expression.cs (ExpressionStatement): New base class used for
24839 expressions that can appear in statements, so that we can provide
24840 an alternate path to generate expression that do not leave a value
24843 (Expression::Emit, and all the derivatives): We no longer return
24844 whether a value is left on the stack or not. Every expression
24845 after being emitted leaves a single value on the stack.
24847 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24848 facilties of ExpressionStatement if possible.
24850 * cs-parser.jay: Update statement_expression.
24852 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24854 * driver.cs: Change the wording of message
24856 2001-09-25 Ravi Pratap <ravi@ximian.com>
24858 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24859 the type of the expression to the return type of the method if
24860 we have an overloaded operator match ! The regression tests pass again !
24861 (Unary::ResolveOperator): Ditto.
24863 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24864 to find "op_Implicit", not "implicit" ;-)
24865 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24866 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24868 * everywhere : Correct calls to the above accordingly.
24870 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24871 (ConvertImplicit): Do user-defined conversion if it exists.
24873 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24875 * assign.cs: track location.
24876 (Resolve): Use implicit conversions on assignment.
24878 * literal.cs: Oops. Not good, Emit of short access values should
24879 pass (Bytes) or the wrong argument will be selected.
24881 * expression.cs (Unary::Emit): Emit code for -expr.
24883 (Unary::ResolveOperator): Handle `Substract' for non-constants
24884 (substract from zero from the non-constants).
24885 Deal with Doubles as well.
24887 (Expression::ConvertImplicitRequired): New routine that reports an
24888 error if no implicit conversion exists.
24890 (Invocation::OverloadResolve): Store the converted implicit
24891 expressions if we make them
24893 2001-09-24 Ravi Pratap <ravi@ximian.com>
24895 * class.cs (ConstructorInitializer): Take a Location argument.
24896 (ConstructorBaseInitializer): Same here.
24897 (ConstructorThisInitializer): Same here.
24899 * cs-parser.jay : Update all calls accordingly.
24901 * expression.cs (Unary, Binary, New): Take location argument.
24902 Update accordingly everywhere.
24904 * cs-parser.jay : Update all calls to the above to take a location
24907 * class.cs : Ditto.
24909 2001-09-24 Ravi Pratap <ravi@ximian.com>
24911 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24912 (Invocation::BetterConversion): Same here
24913 (Invocation::ConversionExists): Ditto.
24915 (Invocation::ConversionExists): Implement.
24917 2001-09-22 Ravi Pratap <ravi@ximian.com>
24919 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24920 Also take an additional TypeContainer argument.
24922 * All over : Pass in TypeContainer as argument to OverloadResolve.
24924 * typemanager.cs (CSharpName): Update to check for the string type and return
24927 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24930 2001-09-21 Ravi Pratap <ravi@ximian.com>
24932 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24933 (Invocation::BetterFunction): Implement.
24934 (Invocation::BetterConversion): Implement.
24935 (Invocation::ConversionExists): Skeleton, no implementation yet.
24937 Okay, things work fine !
24939 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24941 * typemanager.cs: declare and load enum_type, delegate_type and
24944 * expression.cs (Expression::Emit): Now emit returns a value that
24945 tells whether a value is left on the stack or not. This strategy
24946 might be reveted tomorrow with a mechanism that would address
24947 multiple assignments.
24948 (Expression::report118): Utility routine to report mismatches on
24951 (Unary::Report23): Report impossible type/operator combination
24954 (Unary::IsIncrementableNumber): Whether the type can be
24955 incremented or decremented with add.
24956 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24958 (Unary::ResolveOperator): Implement ++, !, ~,
24960 (Invocation::Emit): Deal with new Emit convetion.
24962 * All Expression derivatives: Updated their Emit method to return
24963 whether they leave values on the stack or not.
24965 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24966 stack for expressions that are statements.
24968 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24970 * expression.cs (LValue): New interface. Must be implemented by
24972 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24975 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24976 interface for generating code, simplifies the code.
24978 2001-09-20 Ravi Pratap <ravi@ximian.com>
24980 * expression.cs (everywhere): Comment out return statements in ::Resolve
24981 methods to avoid the warnings.
24983 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24985 * driver.cs (parse): Report error 2001 if we can not open the
24988 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24991 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24994 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24995 otherwise nested blocks end up with the same index.
24997 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24999 * expression.cs: Instead of having FIXMEs in the Resolve
25000 functions, throw exceptions so it is obvious that we are facing a
25003 * cs-parser.jay (invocation_expression): Pass Location information.
25005 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25006 Use a basename for those routines because .NET does not like paths
25009 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25012 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25014 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25015 are loading the correct data types (throws an exception if not).
25016 (TypeManager::InitCoreTypes): Use CoreLookupType
25018 * expression.cs (Unary::ResolveOperator): return the child
25019 expression for expressions which are just +expr.
25020 (Unary::ResolveOperator): Return negative literals for -LITERAL
25021 expressions (otherwise they are Unary {Literal}).
25022 (Invocation::Badness): Take into account `Implicit constant
25023 expression conversions'.
25025 * literal.cs (LongLiteral): Implement long literal class.
25026 (IntLiteral): export the `Value' of the intliteral.
25028 2001-09-19 Ravi Pratap <ravi@ximian.com>
25030 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25032 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25033 instead of 'Operator'
25035 * expression.cs (Binary::ResolveOperator): Update accordingly.
25036 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25039 * cs-parser.jay (unary_expression): Update to use the new names.
25041 * gen-treedump.cs (GetUnary): Same here.
25043 * expression.cs (Unary::Resolve): Implement.
25044 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25045 operators are found instead of making noise ;-)
25046 (Unary::ResolveOperator): New method to do precisely the same thing which
25047 Binary::ResolveOperator does for Binary expressions.
25048 (Unary.method, .Arguments): Add.
25049 (Unary::OperName): Implement.
25050 (Unary::ForceConversion): Copy and Paste !
25052 * class.cs (Operator::Define): Fix a small bug for the case when we have
25055 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25056 for the inbuilt operators. Only overloading works for now ;-)
25058 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25060 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25061 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25063 * expression.cs (This::Emit): Implement.
25064 (This::Resolve): Implement.
25065 (TypeOf:Resolve): Implement.
25066 (Expression::ResolveSimpleName): Add an implicit this to instance
25068 (MemberAccess::Resolve): Deal with Parameters and Fields.
25069 Bind instance variable to Field expressions.
25070 (FieldExpr::Instance): New field used to track the expression that
25071 represents the object instance.
25072 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25074 (FieldExpr::Emit): Implement.
25076 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25077 the last instruction contains a return opcode to avoid generating
25078 the last `ret' instruction (this generates correct code, and it is
25079 nice to pass the peverify output).
25081 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25082 initializer for static and instance variables.
25083 (Constructor::Emit): Allow initializer to be null in the case of
25084 static constructors. Only emit initializer for instance
25087 (TypeContainer::FindMembers): Return a null array if there are no
25090 Also fix the code for the MemberTypes.Method branch, as it was not
25091 scanning that for operators (or tried to access null variables before).
25093 * assign.cs (Assign::Emit): Handle instance and static fields.
25097 * driver.cs: Stop compilation if there are parse errors.
25099 * cs-parser.jay (constructor_declaration): Provide default base
25100 initializer for non-static constructors.
25101 (constructor_declarator): Do not provide a default base
25102 initializers if none was specified.
25103 Catch the fact that constructors should not have parameters.
25105 * class.cs: Do not emit parent class initializers for static
25106 constructors, that should be flagged as an error.
25108 2001-09-18 Ravi Pratap <ravi@ximian.com>
25110 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25111 Move back code into TypeContainer::Populate.
25113 2001-09-18 Ravi Pratap <ravi@ximian.com>
25115 * class.cs (TypeContainer::AddConstructor): Fix the check to
25116 compare against Name, not Basename.
25117 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25119 * cs-parser.jay : Update accordingly.
25121 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25122 for methods, don't forget to look into the operators too.
25123 (RegisterMethodBuilder): Helper method to take care of this for
25124 methods, constructors and operators.
25125 (Operator::Define): Completely revamp.
25126 (Operator.OperatorMethod, MethodName): New fields.
25127 (TypeContainer::Populate): Move the registering of builders into
25128 RegisterMethodBuilder.
25129 (Operator::Emit): Re-write.
25131 * expression.cs (Binary::Emit): Comment out code path to emit method
25132 invocation stuff for the case when we have a user defined operator. I am
25133 just not able to get it right !
25135 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25137 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25140 (Expression::MemberLookup): Provide a version that allows to
25141 specify the MemberTypes and BindingFlags.
25143 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25144 so it was not fetching variable information from outer blocks.
25146 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25147 Beforefieldinit as it was buggy.
25149 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25150 that Ravi put here.
25152 * class.cs (Constructor::Emit): Only emit if block is not null.
25153 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25154 deal with this by semantically definining it as if the user had
25157 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25158 constructors as we now "emit" them at a higher level.
25160 (TypeContainer::DefineDefaultConstructor): Used to define the
25161 default constructors if none was provided.
25163 (ConstructorInitializer): Add methods Resolve and Emit.
25165 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25167 2001-09-17 Ravi Pratap <ravi@ximian.com>
25169 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25170 the default constructor builder with our hashtable for methodbuilders
25173 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25174 and argument_count is 0 in which case we have a match.
25175 (Binary::ResolveOperator): More null checking and miscellaneous coding
25178 2001-09-17 Ravi Pratap <ravi@ximian.com>
25180 * rootcontext.cs (IsNameSpace): Compare against null.
25182 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25184 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25185 and Unary::Operator.
25187 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25190 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25191 we have overloaded operators.
25192 (Binary::ResolveOperator): Implement the part which does the operator overload
25195 * class.cs (Operator::Emit): Implement.
25196 (TypeContainer::Emit): Emit the operators we have too.
25198 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25199 the case when we have a user-defined operator.
25201 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25203 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25205 2001-09-16 Ravi Pratap <ravi@ximian.com>
25207 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25208 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25209 (Constructor::Emit): Implement.
25210 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25211 if we have no work to do.
25212 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25215 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25216 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25218 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25221 2001-09-15 Ravi Pratap <ravi@ximian.com>
25223 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25225 (Tree::RecordNamespace): Method to do what the name says ;-)
25226 (Tree::Namespaces): Property to get at the namespaces hashtable.
25228 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25231 * rootcontext.cs (IsNamespace): Fixed it :-)
25233 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25235 * class.cs (TypeContainer::FindMembers): Add support for
25237 (MethodCore): New class that encapsulates both the shared aspects
25238 of a Constructor and a Method.
25239 (Method, Constructor): Factored pieces into MethodCore.
25241 * driver.cs: Added --fatal which makes errors throw exceptions.
25242 Load System assembly as well as part of the standard library.
25244 * report.cs: Allow throwing exceptions on errors for debugging.
25246 * modifiers.cs: Do not use `parent', instead use the real type
25247 container to evaluate permission settings.
25249 * class.cs: Put Ravi's patch back in. He is right, and we will
25250 have to cope with the
25252 2001-09-14 Ravi Pratap <ravi@ximian.com>
25254 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25255 FamORAssem, not FamANDAssem.
25257 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25259 * driver.cs: Added --parse option that only parses its input files
25262 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25263 incorrect. IsTopLevel is not used to tell whether an object is
25264 root_types or not (that can be achieved by testing this ==
25265 root_types). But to see if this is a top-level *class* (not
25266 necessarly our "toplevel" container).
25268 2001-09-14 Ravi Pratap <ravi@ximian.com>
25270 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25271 parent instead of a direct call to GetType.
25273 2001-09-14 Ravi Pratap <ravi@ximian.com>
25275 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25276 Modifiers.TypeAttr. This should just be a call to that method.
25278 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25279 object so that we can determine if we are top-level or not.
25281 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25284 * enum.cs (Enum::Define): Ditto.
25286 * modifiers.cs (FieldAttr): Re-write.
25288 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25289 (TypeContainer::HaveStaticConstructor): New property to provide access
25290 to precisely that info.
25292 * modifiers.cs (MethodAttr): Re-write.
25293 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25295 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25296 of top-level types as claimed.
25298 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25300 * expression.cs (MemberLookup): Fruitless attempt to lookup
25301 constructors. Maybe I need to emit default constructors? That
25302 might be it (currently .NET emits this for me automatically).
25303 (Invocation::OverloadResolve): Cope with Arguments == null.
25304 (Invocation::EmitArguments): new function, shared by the new
25305 constructor and us.
25306 (Invocation::Emit): Handle static and instance methods. Emit
25307 proper call instruction for virtual or non-virtual invocations.
25308 (New::Emit): Implement.
25309 (New::Resolve): Implement.
25310 (MemberAccess:Resolve): Implement.
25311 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25312 to track instances.
25313 (FieldExpr::Resolve): Set type.
25315 * support.cs: Handle empty arguments.
25317 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25318 SimpleLookup): Auxiliary routines to help parse a qualifier
25321 Update qualifier_identifier rule.
25323 * codegen.cs: Removed debugging messages.
25325 * class.cs: Make this a global thing, this acts just as a "key" to
25326 objects that we might have around.
25328 (Populate): Only initialize method_builders_to_methods once.
25330 * expression.cs (PropertyExpr): Initialize type from the
25333 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25334 Resolve pattern. Attempt to implicitly convert value to boolean.
25337 * expression.cs: Set the type for the int32/int32 argument case.
25338 (Binary::ResolveOperator): Set the return type to boolean for
25339 comparission operators
25341 * typemanager.cs: Remove debugging print code.
25343 (Invocation::Resolve): resolve type.
25345 * class.cs: Allocate a MemberInfo of the correct size, as the code
25346 elsewhere depends on the test to reflect the correct contents.
25348 (Method::) Keep track of parameters, due to System.Reflection holes
25350 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25353 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25354 of the exact size and return that.
25356 (Class::LookupMethodByBuilder): New function that maps
25357 MethodBuilders to its methods. Required to locate the information
25358 on methods because System.Reflection bit us again.
25360 * support.cs: New file, contains an interface ParameterData and
25361 two implementations: ReflectionParameters and InternalParameters
25362 used to access Parameter information. We will need to grow this
25365 * expression.cs (Invocation::GetParameterData): implement a cache
25366 and a wrapper around the ParameterData creation for methods.
25367 (Invocation::OverloadResolve): Use new code.
25369 2001-09-13 Ravi Pratap <ravi@ximian.com>
25371 * class.cs (TypeContainer::EmitField): Remove and move into
25372 (Field::Define): here and modify accordingly.
25373 (Field.FieldBuilder): New member.
25374 (TypeContainer::Populate): Update accordingly.
25375 (TypeContainer::FindMembers): Implement.
25377 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25379 * statement.cs: (VariableInfo::VariableType): New field to be
25380 initialized with the full type once it is resolved.
25382 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25384 * parameter.cs (GetParameterInfo): Use a type cache to compute
25385 things only once, and to reuse this information
25387 * expression.cs (LocalVariableReference::Emit): Implement.
25388 (OpcodeCast::Emit): fix.
25390 (ParameterReference::Resolve): Implement.
25391 (ParameterReference::Emit): Implement.
25393 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25394 that are expressions need to stay as Expressions.
25396 * typemanager.cs (CSharpName): Returns the C# name of a type if
25399 * expression.cs (Expression::ConvertImplicit): New function that
25400 implements implicit type conversions.
25402 (Expression::ImplicitReferenceConversion): Implements implicit
25403 reference conversions.
25405 (EmptyCast): New type for transparent casts.
25407 (OpcodeCast): New type for casts of types that are performed with
25408 a sequence of bytecodes.
25410 (BoxedCast): New type used for casting value types into reference
25411 types. Emits a box opcode.
25413 (Binary::DoNumericPromotions): Implements numeric promotions of
25414 and computation of the Binary::Type.
25416 (Binary::EmitBranchable): Optimization.
25418 (Binary::Emit): Implement code emission for expressions.
25420 * typemanager.cs (TypeManager): Added two new core types: sbyte
25423 2001-09-12 Ravi Pratap <ravi@ximian.com>
25425 * class.cs (TypeContainer::FindMembers): Method which does exactly
25426 what Type.FindMembers does, only we don't have to use reflection. No
25427 implementation yet.
25429 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25430 typecontainer objects as we need to get at them.
25431 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25433 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25434 typecontainer object.
25436 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25437 of just a Report object.
25439 2001-09-11 Ravi Pratap <ravi@ximian.com>
25441 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25443 (TypeContainer::Populate): Now define the delegates of the type too.
25444 (TypeContainer.Delegates): Property to access the list of delegates defined
25447 * delegates.cs (Delegate::Define): Implement partially.
25449 * modifiers.cs (TypeAttr): Handle more flags.
25451 2001-09-11 Ravi Pratap <ravi@ximian.com>
25453 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25455 (Operator::Define): Re-write logic to get types by using the LookupType method
25456 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25457 (Indexer::Define): Ditto.
25458 (Event::Define): Ditto.
25459 (Property::Define): Ditto.
25461 2001-09-10 Ravi Pratap <ravi@ximian.com>
25463 * class.cs (TypeContainer::Populate): Now define operators too.
25464 (TypeContainer.Operators): New property to access the list of operators
25466 (Operator.OperatorMethodBuilder): New member to hold the method builder
25467 for the operator we are defining.
25468 (Operator::Define): Implement.
25470 2001-09-10 Ravi Pratap <ravi@ximian.com>
25472 * class.cs (Event::Define): Make the prefixes of the accessor methods
25473 addOn_ and removeOn_
25475 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25476 of the location being passed in too. Ideally, this should go later since all
25477 error reporting should be done through the Report object.
25479 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25480 (Populate): Iterate thru the indexers we have and define them too.
25481 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25482 for the get and set accessors.
25483 (Indexer::Define): Implement.
25485 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25487 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25488 my previous implementation, did not work.
25490 * typemanager.cs: Add a couple of missing types (the longs).
25492 * literal.cs: Use TypeManager.bool_type instead of getting it.
25494 * expression.cs (EventExpr): New kind of expressions.
25495 (Expressio::ExprClassFromMemberInfo): finish
25497 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25499 * assign.cs: Emit stores to static fields differently.
25501 2001-09-08 Ravi Pratap <ravi@ximian.com>
25503 * Merge in changes and adjust code to tackle conflicts. Backed out my
25504 code in Assign::Resolve ;-)
25506 2001-09-08 Ravi Pratap <ravi@ximian.com>
25508 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25509 instead Report.Error and also pass in the location.
25510 (CSharpParser::Lexer): New readonly property to return the reference
25511 to the Tokenizer object.
25512 (declare_local_variables): Use Report.Error with location instead of plain
25516 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25517 (Operator.CheckBinaryOperator): Ditto.
25519 * cs-parser.jay (operator_declarator): Update accordingly.
25521 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25522 (CheckBinaryOperator): Same here.
25524 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25525 on the name without any prefixes of namespace names etc. This is because we
25526 already might have something already fully qualified like
25527 'System.Console.WriteLine'
25529 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25531 2001-09-07 Ravi Pratap <ravi@ximian.com>
25533 * cs-tokenizer.cs (location): Return a string which also contains
25536 * expression.cs (ElementAccess): New class for expressions of the
25537 type 'element access.'
25538 (BaseAccess): New class for expressions of the type 'base access.'
25539 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25542 * cs-parser.jay (element_access): Implement action.
25543 (base_access): Implement actions.
25544 (checked_expression, unchecked_expression): Implement.
25546 * cs-parser.jay (local_variable_type): Correct and implement.
25547 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25549 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25551 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25552 name and the specifiers.
25554 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25556 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25557 making them all public ;-)
25559 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25562 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25564 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25566 (FieldExpr, PropertyExprs): New resolved expressions.
25567 (SimpleName::MemberStaticCheck): Perform static checks for access
25568 to non-static fields on static methods. Maybe this should be
25569 generalized for MemberAccesses.
25570 (SimpleName::ResolveSimpleName): More work on simple name
25573 * cs-parser.jay (primary_expression/qualified_identifier): track
25574 the parameter index.
25576 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25577 (EmitContext::EmitBoolExpression): Chain to expression generation
25578 instead of temporary hack.
25579 (::EmitStatementExpression): Put generic expression code generation.
25581 * assign.cs (Assign::Emit): Implement variable assignments to
25582 local variables, parameters and fields.
25584 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25586 * statement.cs (Block::GetVariableInfo): New method, returns the
25587 VariableInfo for a variable name in a block.
25588 (Block::GetVariableType): Implement in terms of GetVariableInfo
25590 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25591 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25593 2001-09-06 Ravi Pratap <ravi@ximian.com>
25595 * cs-parser.jay (operator_declaration): Continue on my quest : update
25596 to take attributes argument.
25597 (event_declaration): Ditto.
25598 (enum_declaration): Ditto.
25599 (indexer_declaration): Ditto.
25601 * class.cs (Operator::Operator): Update constructor accordingly.
25602 (Event::Event): Ditto.
25604 * delegate.cs (Delegate::Delegate): Same here.
25606 * enum.cs (Enum::Enum): Same here.
25608 2001-09-05 Ravi Pratap <ravi@ximian.com>
25610 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25612 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25614 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25615 being passed around as an arraylist.
25616 (Attributes::AddAttribute): Method to add attribute sections.
25618 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25619 (struct_declaration): Update accordingly.
25620 (constant_declaration): Update.
25621 (field_declaration): Update.
25622 (method_header): Update.
25623 (fixed_parameter): Update.
25624 (parameter_array): Ditto.
25625 (property_declaration): Ditto.
25626 (destructor_declaration): Ditto.
25628 * class.cs (Struct::Struct): Update constructors accordingly.
25629 (Class::Class): Ditto.
25630 (Field::Field): Ditto.
25631 (Method::Method): Ditto.
25632 (Property::Property): Ditto.
25633 (TypeContainer::OptAttribute): update property's return type.
25635 * interface.cs (Interface.opt_attributes): New member.
25636 (Interface::Interface): Update to take the extra Attributes argument.
25638 * parameter.cs (Parameter::Parameter): Ditto.
25640 * constant.cs (Constant::Constant): Ditto.
25642 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25643 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25644 the attributes as a parameter.
25645 (InterfaceProperty): Update constructor call.
25646 (InterfaceEvent): Ditto.
25647 (InterfaceMethod): Ditto.
25648 (InterfaceIndexer): Ditto.
25650 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25651 pass the attributes too.
25652 (interface_event_declaration): Ditto.
25653 (interface_property_declaration): Ditto.
25654 (interface_method_declaration): Ditto.
25655 (interface_declaration): Ditto.
25657 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25659 * class.cs (Method::Define): Track the "static Main" definition to
25660 create an entry point.
25662 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25663 EntryPoint if we find it.
25665 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25666 (EmitContext::ig): Make this variable public.
25668 * driver.cs: Make the default output file be the first file name
25669 with the .exe extension.
25671 Detect empty compilations
25673 Handle various kinds of output targets. Handle --target and
25674 rename -t to --dumper.
25676 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25677 methods inherited from Expression return now an Expression. This
25678 will is used during the tree rewriting as we resolve them during
25681 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25682 the spec. Missing entirely is the information about
25683 accessability of elements of it.
25685 (Expression::ExprClassFromMemberInfo): New constructor for
25686 Expressions that creates a fully initialized Expression based on
25687 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25690 (Invocation::Resolve): Begin implementing resolution of invocations.
25692 * literal.cs (StringLiteral): Implement Emit.
25694 2001-09-05 Ravi Pratap <ravi@ximian.com>
25696 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25699 2001-09-04 Ravi Pratap <ravi@ximian.com>
25701 * cs-parser.jay (attribute_arguments): Implement actions.
25702 (attribute): Fix bug in production. Implement action.
25703 (attribute_list): Implement.
25704 (attribute_target): Implement.
25705 (attribute_target_specifier, opt_target_specifier): Implement
25706 (CheckAttributeTarget): New method to check if the attribute target
25708 (attribute_section): Implement.
25709 (opt_attributes): Implement.
25711 * attribute.cs : New file to handle attributes.
25712 (Attribute): Class to hold attribute info.
25714 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25715 (attribute_section): Modify production to use 2 different rules to
25716 achieve the same thing. 1 s/r conflict down !
25717 Clean out commented, useless, non-reducing dimension_separator rules.
25719 * class.cs (TypeContainer.attributes): New member to hold list
25720 of attributes for a type.
25721 (Struct::Struct): Modify to take one more argument, the attribute list.
25722 (Class::Class): Ditto.
25723 (Field::Field): Ditto.
25724 (Method::Method): Ditto.
25725 (Property::Property): Ditto.
25727 * cs-parser.jay (struct_declaration): Update constructor call to
25728 pass in the attributes too.
25729 (class_declaration): Ditto.
25730 (constant_declaration): Ditto.
25731 (field_declaration): Ditto.
25732 (method_header): Ditto.
25733 (fixed_parameter): Ditto.
25734 (parameter_array): Ditto.
25735 (property_declaration): Ditto.
25737 * constant.cs (Constant::Constant): Update constructor similarly.
25738 Use System.Collections.
25740 * parameter.cs (Parameter::Parameter): Update as above.
25742 2001-09-02 Ravi Pratap <ravi@ximian.com>
25744 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25745 (TypeContainer.delegates): New member to hold list of delegates.
25747 * cs-parser.jay (delegate_declaration): Implement the action correctly
25748 this time as I seem to be on crack ;-)
25750 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25752 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25753 tell whether an identifier represents a namespace.
25755 * expression.cs (NamespaceExpr): A namespace expression, used only
25756 temporarly during expression resolution.
25757 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25758 utility functions to resolve names on expressions.
25760 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25762 * codegen.cs: Add hook for StatementExpressions.
25764 * class.cs: Fix inverted test for static flag in methods.
25766 2001-09-02 Ravi Pratap <ravi@ximian.com>
25768 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25769 to make it coincide with MS' number.
25770 (Operator::CheckBinaryOperator): Ditto.
25772 * ../errors/errors.txt : Remove error numbers added earlier.
25774 * ../errors/cs1019.cs : Test case for error # 1019
25776 * ../errros/cs1020.cs : Test case for error # 1020
25778 * cs-parser.jay : Clean out commented cruft.
25779 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25780 used anywhere - non-reducing rule.
25781 (namespace_declarations): Non-reducing rule - comment out.
25783 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25784 with TypeContainer::AddEnum.
25786 * delegate.cs : New file for delegate handling classes.
25787 (Delegate): Class for declaring delegates.
25789 * makefile : Update.
25791 * cs-parser.jay (delegate_declaration): Implement.
25793 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25795 * class.cs (Event::Define): Implement.
25796 (Event.EventBuilder): New member.
25798 * class.cs (TypeContainer::Populate): Update to define all enums and events
25800 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25801 readonly fields for all these cases ?
25803 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25805 * class.cs (Property): Revamp to use the convention of making fields readonly.
25806 Accordingly modify code elsewhere.
25808 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25809 the Define method of the Property class.
25811 * class.cs : Clean up applied patch and update references to variables etc. Fix
25813 (TypeContainer::Populate): Update to define all the properties we have. Also
25814 define all enumerations.
25816 * enum.cs (Define): Implement.
25818 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25820 * cs-parser.jay (overloadable_operator): The semantic value is an
25821 enum of the Operator class.
25822 (operator_declarator): Implement actions.
25823 (operator_declaration): Implement.
25825 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25826 validity of definitions.
25827 (Operator::CheckBinaryOperator): Static method to check for binary operators
25828 (TypeContainer::AddOperator): New method to add an operator to a type.
25830 * cs-parser.jay (indexer_declaration): Added line to actually call the
25831 AddIndexer method so it gets added ;-)
25833 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25834 already taken care of by the MS compiler ?
25836 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25838 * class.cs (Operator): New class for operator declarations.
25839 (Operator::OpType): Enum for the various operators.
25841 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25843 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25844 ostensibly handle this in semantic analysis.
25846 * cs-parser.jay (general_catch_clause): Comment out
25847 (specific_catch_clauses, specific_catch_clause): Ditto.
25848 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25849 (catch_args, opt_catch_args): New productions.
25850 (catch_clause): Rewrite to use the new productions above
25851 (catch_clauses): Modify accordingly.
25852 (opt_catch_clauses): New production to use in try_statement
25853 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25854 and re-write the code in the actions to extract the specific and
25855 general catch clauses by being a little smart ;-)
25857 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25858 Hooray, try and catch statements parse fine !
25860 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25862 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25863 string from the hashtable of variables.
25865 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25866 I end up making that mistake ;-)
25867 (catch_clauses): Fixed gross error which made Key and Value of the
25868 DictionaryEntry the same : $1 !!
25870 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25872 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25874 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25875 when the add and remove accessors are specified.
25877 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25879 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25880 information about indexer_declarator.
25881 (indexer_declarator): Implement actions.
25882 (parsing_indexer): New local boolean used to keep track of whether
25883 we are parsing indexers or properties. This is necessary because
25884 implicit_parameters come into picture even for the get accessor in the
25885 case of an indexer.
25886 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25888 * class.cs (Indexer): New class for indexer declarations.
25889 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25890 (TypeContainer::indexers): New member to hold list of indexers for the
25893 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25895 * cs-parser.jay (add_accessor_declaration): Implement action.
25896 (remove_accessor_declaration): Implement action.
25897 (event_accessors_declaration): Implement
25898 (variable_declarators): swap statements for first rule - trivial.
25900 * class.cs (Event): New class to hold information about event
25902 (TypeContainer::AddEvent): New method to add an event to a type
25903 (TypeContainer::events): New member to hold list of events.
25905 * cs-parser.jay (event_declaration): Implement actions.
25907 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25909 * cs-parser.jay (dim_separators): Implement. Make it a string
25910 concatenating all the commas together, just as they appear.
25911 (opt_dim_separators): Modify accordingly
25912 (rank_specifiers): Update accordingly. Basically do the same
25913 thing - instead, collect the brackets here.
25914 (opt_rank_sepcifiers): Modify accordingly.
25915 (array_type): Modify to actually return the complete type string
25916 instead of ignoring the rank_specifiers.
25917 (expression_list): Implement to collect the expressions
25918 (variable_initializer): Implement. We make it a list of expressions
25919 essentially so that we can handle the array_initializer case neatly too.
25920 (variable_initializer_list): Implement.
25921 (array_initializer): Make it a list of variable_initializers
25922 (opt_array_initializer): Modify accordingly.
25924 * expression.cs (New::NType): Add enumeration to help us
25925 keep track of whether we have an object/delegate creation
25926 or an array creation.
25927 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25928 members to hold data about array creation.
25929 (New:New): Modify to update NewType
25930 (New:New): New Overloaded contructor for the array creation
25933 * cs-parser.jay (array_creation_expression): Implement to call
25934 the overloaded New constructor.
25936 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25938 * class.cs (TypeContainer::Constructors): Return member
25939 constructors instead of returning null.
25941 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25943 * typemanager.cs (InitCoreTypes): Initialize the various core
25944 types after we have populated the type manager with the user
25945 defined types (this distinction will be important later while
25946 compiling corlib.dll)
25948 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25949 on Expression Classification. Now all expressions have a method
25950 `Resolve' and a method `Emit'.
25952 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25953 generation from working. Also add some temporary debugging
25956 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25958 * codegen.cs: Lots of code generation pieces. This is only the
25959 beginning, will continue tomorrow with more touches of polish. We
25960 handle the fundamentals of if, while, do, for, return. Others are
25961 trickier and I need to start working on invocations soon.
25963 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25966 * codegen.cs (EmitContext): New struct, used during code
25967 emission to keep a context. Most of the code generation will be
25970 * cs-parser.jay: Add embedded blocks to the list of statements of
25971 this block. So code generation proceeds in a top down fashion.
25973 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25975 * statement.cs: Add support for multiple child blocks.
25977 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25979 * codegen.cs (EmitCode): New function, will emit the code for a
25980 Block of code given a TypeContainer and its ILGenerator.
25982 * statement.cs (Block): Standard public readonly optimization.
25983 (Block::Block constructors): Link children.
25984 (Block::Child): Child Linker.
25985 (Block::EmitVariables): Emits IL variable declarations.
25987 * class.cs: Drop support for MethodGroups here, delay until
25989 (Method::): Applied the same simplification that I did before, and
25990 move from Properties to public readonly fields.
25991 (Method::ParameterTypes): Returns the parameter types for the
25992 function, and implements a cache that will be useful later when I
25993 do error checking and the semantic analysis on the methods is
25995 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25996 and made a method, optional argument tells whether this is a class
25997 or a structure to apply the `has-this' bit.
25998 (Method::GetCallingConvention): Implement, returns the calling
26000 (Method::Define): Defines the type, a second pass is performed
26001 later to populate the methods.
26003 (Constructor::ParameterTypes): implement a cache similar to the
26004 one on Method::ParameterTypes, useful later when we do semantic
26007 (TypeContainer::EmitMethod): New method. Emits methods.
26009 * expression.cs: Removed MethodGroup class from here.
26011 * parameter.cs (Parameters::GetCallingConvention): new method.
26013 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26015 * class.cs (TypeContainer::Populate): Drop RootContext from the
26018 (Constructor::CallingConvention): Returns the calling convention.
26019 (Constructor::ParameterTypes): Returns the constructor parameter
26022 (TypeContainer::AddConstructor): Keep track of default constructor
26023 and the default static constructor.
26025 (Constructor::) Another class that starts using `public readonly'
26026 instead of properties.
26028 (Constructor::IsDefault): Whether this is a default constructor.
26030 (Field::) use readonly public fields instead of properties also.
26032 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26033 track of static constructors; If none is used, turn on
26034 BeforeFieldInit in the TypeAttributes.
26036 * cs-parser.jay (opt_argument_list): now the return can be null
26037 for the cases where there are no arguments.
26039 (constructor_declarator): If there is no implicit `base' or
26040 `this', then invoke the default parent constructor.
26042 * modifiers.cs (MethodAttr): New static function maps a set of
26043 modifiers flags into a MethodAttributes enum
26044 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26045 MethodAttr, TypeAttr to represent the various mappings where the
26046 modifiers are used.
26047 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26049 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26051 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26054 * interface.cs (PopulateIndexer): Implemented the code generator
26055 for interface indexers.
26057 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26059 * interface.cs (InterfaceMemberBase): Now we track the new status
26062 (PopulateProperty): Implement property population. Woohoo! Got
26063 Methods and Properties going today.
26065 Removed all the properties for interfaces, and replaced them with
26066 `public readonly' fields.
26068 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26070 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26071 initialize their hashtables/arraylists only when they are needed
26072 instead of doing this always.
26074 * parameter.cs: Handle refs and out parameters.
26076 * cs-parser.jay: Use an ArrayList to construct the arguments
26077 instead of the ParameterCollection, and then cast that to a
26080 * parameter.cs: Drop the use of ParameterCollection and use
26081 instead arrays of Parameters.
26083 (GetParameterInfo): Use the Type, not the Name when resolving
26086 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26088 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26089 and instead use public readonly fields.
26091 * class.cs: Put back walking code for type containers.
26093 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26095 * class.cs (MakeConstant): Code to define constants.
26097 * rootcontext.cs (LookupType): New function. Used to locate types
26100 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26102 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26103 this System.Reflection code is. Kudos to Microsoft
26105 * typemanager.cs: Implement a type cache and avoid loading all
26106 types at boot time. Wrap in LookupType the internals. This made
26107 the compiler so much faster. Wow. I rule!
26109 * driver.cs: Make sure we always load mscorlib first (for
26110 debugging purposes, nothing really important).
26112 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26113 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26115 * rootcontext.cs: Lookup types on their namespace; Lookup types
26116 on namespaces that have been imported using the `using' keyword.
26118 * class.cs (TypeContainer::TypeAttr): Virtualize.
26119 (Class::TypeAttr): Return attributes suitable for this bad boy.
26120 (Struct::TypeAttr): ditto.
26121 Handle nested classes.
26122 (TypeContainer::) Remove all the type visiting code, it is now
26123 replaced with the rootcontext.cs code
26125 * rootcontext.cs (GetClassBases): Added support for structs.
26127 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26129 * interface.cs, statement.cs, class.cs, parameter.cs,
26130 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26131 Drop use of TypeRefs, and use strings instead.
26133 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26137 * class.cs (Struct::Struct): set the SEALED flags after
26138 checking the modifiers.
26139 (TypeContainer::TypeAttr): new property, returns the
26140 TypeAttributes for a class.
26142 * cs-parser.jay (type_list): Oops, list production was creating a
26143 new list of base types.
26145 * rootcontext.cs (StdLib): New property.
26146 (GetInterfaceTypeByName): returns an interface by type name, and
26147 encapsulates error handling here.
26148 (GetInterfaces): simplified.
26149 (ResolveTree): Encapsulated all the tree resolution here.
26150 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26153 * driver.cs: Add support for --nostdlib, to avoid loading the
26154 default assemblies.
26155 (Main): Do not put tree resolution here.
26157 * rootcontext.cs: Beginning of the class resolution.
26159 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26161 * rootcontext.cs: Provide better error reporting.
26163 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26165 * rootcontext.cs (CreateInterface): Handle the case where there
26166 are no parent interfaces.
26168 (CloseTypes): Routine to flush types at the end.
26169 (CreateInterface): Track types.
26170 (GetInterfaces): Returns an array of Types from the list of
26171 defined interfaces.
26173 * typemanager.c (AddUserType): Mechanism to track user types (puts
26174 the type on the global type hash, and allows us to close it at the
26177 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26179 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26180 RecordInterface instead.
26182 * cs-parser.jay: Updated to reflect changes above.
26184 * decl.cs (Definition): Keep track of the TypeBuilder type that
26185 represents this type here. Not sure we will use it in the long
26186 run, but wont hurt for now.
26188 * driver.cs: Smaller changes to accomodate the new code.
26190 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26193 * rootcontext.cs (CreateInterface): New method, used to create
26194 the System.TypeBuilder type for interfaces.
26195 (ResolveInterfaces): new entry point to resolve the interface
26197 (CodeGen): Property, used to keep track of the code generator.
26199 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26201 * cs-parser.jay: Add a second production for delegate_declaration
26204 (enum_body): Put an opt_comma here instead of putting it on
26205 enum_body or enum_member_declarations so we can handle trailing
26206 commas on enumeration members. Gets rid of a shift/reduce.
26208 (type_list): Need a COMMA in the middle.
26210 (indexer_declaration): Tell tokenizer to recognize get/set
26212 * Remove old targets.
26214 * Re-add the parser target.
26216 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26218 * cs-parser.jay: Add precendence rules for a number of operators
26219 ot reduce the number of shift/reduce conflicts in the grammar.
26221 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26223 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26226 Get rid of old crufty code.
26228 * rootcontext.cs: Use this to keep track of the parsed
26229 representation and the defined types available to the program.
26231 * gen-treedump.cs: adjust for new convention.
26233 * type.cs: Split out the type manager, and the assembly builder
26236 * typemanager.cs: the type manager will live here now.
26238 * cil-codegen.cs: And the code generator here.
26240 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26242 * makefile: Fixed up for easy making.
26244 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26246 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26249 (unary_expression): Expand pre_increment_expression and
26250 post_decrement_expression to reduce a shift/reduce.
26252 2001-07-11 Simon Cozens
26254 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26256 Improve allow_keyword_as_indent name.
26258 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26260 * Adjustments for Beta2.
26262 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26264 * decl.cs: Added `Define' abstract method.
26265 (InTransit): new property, used to catch recursive definitions.
26267 * interface.cs: Implement `Define'.
26269 * modifiers.cs: Map Modifiers.constants to
26270 System.Reflection.TypeAttribute flags.
26272 * class.cs: Keep track of types and user-defined types.
26273 (BuilderInit): New method for creating an assembly
26274 (ResolveType): New function to launch the resolution process, only
26275 used by interfaces for now.
26277 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26278 that are inserted into the name space.
26280 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26282 * ARGH. I have screwed up my tree so many times due to the use of
26283 rsync rather than using CVS. Going to fix this at once.
26285 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26288 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26290 * Experiment successful: Use System.Type rather that our own
26293 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26295 * cs-parser.jay: Removed nsAliases from here.
26297 Use new namespaces, handle `using XXX;'
26299 * namespace.cs: Reimplemented namespace handling, use a recursive
26300 definition of the class. Now we can keep track of using clauses
26301 and catch invalid using clauses.
26303 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26305 * gen-treedump.cs: Adapted for all the renaming.
26307 * expression.cs (Expression): this class now has a Type property
26308 which returns an expression Type.
26310 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26311 `Type', as this has a different meaning now in the base
26313 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26315 * interface.cs, class.cs: Removed from all the sources the
26316 references to signature computation, as we can not do method
26317 signature computation during the parsing time, as we are not
26318 trying to solve at that point distinguishing:
26322 void a (NS.Blah x) {}
26325 Which depending on the context might be valid or not, as we do not
26326 know if Blah is the same thing as NS.Blah at that point.
26328 * Redid everything so the code uses TypeRefs now instead of
26329 Types. TypeRefs are just temporary type placeholders, that need
26330 to be resolved. They initially have a pointer to a string and the
26331 current scope in which they are used. This is used later by the
26332 compiler to resolve the reference to an actual Type.
26334 * DeclSpace is no longer a CIR.Type, and neither are
26335 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26336 are all DeclSpaces, but no Types.
26338 * type.cs (TypeRefManager): This implements the TypeRef manager,
26339 which keeps track of all the types that need to be resolved after
26340 the parsing has finished.
26342 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26344 * ARGH. We are going to have to store `foreach' as a class rather
26345 than resolving it, as we need to verify error 1579 after name
26346 resolution. *OR* we could keep a flag that says `This request to
26347 IEnumerator comes from a foreach statement' which we can then use
26348 to generate the error.
26350 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26352 * class.cs (TypeContainer.AddMethod): we now add methods to the
26353 MethodGroup instead of the method hashtable.
26355 * expression.cs: Add MethodGroup abstraction, which gets us one
26356 step closer to the specification in the way we handle method
26359 * cs-parser.jay (primary_expression): qualified_identifier now
26360 tried to match up an identifier to a local variable reference or
26361 to a parameter reference.
26363 current_local_parameters is now a parser global variable that
26364 points to the current parameters for the block, used during name
26367 (property_declaration): Now creates an implicit `value' argument to
26370 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26372 * parameter.cs: Do not use `param' arguments as part of the
26373 signature, per the spec.
26375 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26377 * decl.cs: Base class for classes, structs and interfaces. This
26378 is the "Declaration Space"
26380 * cs-parser.jay: Use CheckDef for checking declaration errors
26381 instead of having one on each function.
26383 * class.cs: Factor out some code for handling error handling in
26384 accordance to the "Declarations" section in the "Basic Concepts"
26385 chapter in the ECMA C# spec.
26387 * interface.cs: Make all interface member classes derive from
26388 InterfaceMemberBase.
26390 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26392 * Many things: all interfaces are parsed and generated in
26393 gen-treedump. Support for member variables, constructors,
26394 destructors, properties, constants is there.
26396 Beginning of the IL backend, but very little done, just there for
26399 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26401 * cs-parser.jay: Fix labeled statement.
26403 * cs-tokenizer.cs (escape): Escape " and ' always.
26404 ref_line, ref_name: keep track of the line/filename as instructed
26405 by #line by the compiler.
26408 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26410 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26411 to match the values in System.CodeDOM.
26413 Divid renamed to Divide.
26415 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26417 (Statements.set): remove.
26419 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26422 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26423 falseStatements always have valid values.
26425 * cs-parser.jay: Use System.CodeDOM now.